From 2f60fe717ed859bcd58ba7ff0b110586b121689c Mon Sep 17 00:00:00 2001 From: Billy Jacoby Date: Wed, 10 May 2023 08:43:49 -0400 Subject: [PATCH] chore: auto update release file --- bin/post-bump.sh | 23 +++++++++++++++++++++++ package.json | 4 ++-- updates.json | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100755 bin/post-bump.sh diff --git a/bin/post-bump.sh b/bin/post-bump.sh new file mode 100755 index 0000000..cce6e54 --- /dev/null +++ b/bin/post-bump.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +##? Version has been bumped, so we should create a build here then update the +##? updates.json file with the tar.gz.sig provided. Have to figure out how to target the previous version number here though + +echo "Building release..." +yarn build:release + +export UPDATE_SIG_FILE="./src-tauri/target/release/bundle/macos/Browsernaut.app.tar.gz.sig" +export UPDATE_SIG=$(cat $UPDATE_SIG_FILE) + +export PUBLISH_DATE=$(date -u -Iseconds | sed s/+00:00/Z/ | sed s/,/./) + +echo "Updating updates file" + +# #? Update the version +sed -i "" "s/$LATEST_VERSION/$VERSION/g" "./updates.json" +# #? Update the signature +sed -i "" "s/\"signature\":.*/\"signature\": \"$UPDATE_SIG\",/" "./updates.json" +#? Update the pubplish date +sed -i "" "s/\"pub_date\":.*/\"pub_date\": \"$PUBLISH_DATE\",/" "./updates.json" + +echo "Complete!" \ No newline at end of file diff --git a/package.json b/package.json index ff425be..283590c 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "sign": "dotenv ./bin/apple.sh", "preview": "vite preview", "tauri": "tauri", - "release": "release-it" + "release": "release-it --verbose" }, "dependencies": { "@hello-pangea/dnd": "^16.2.0", @@ -49,7 +49,7 @@ }, "release-it": { "hooks": { - "after:bump": "yarn auto-changelog -p" + "after:bump": "yarn auto-changelog -p && VERSION=${version} LATEST_VERSION=${latestVersion} ./bin/post-bump.sh" }, "git": { "commitMessage": "chore: release v${version}", diff --git a/updates.json b/updates.json index 0853617..84e65ab 100644 --- a/updates.json +++ b/updates.json @@ -4,7 +4,7 @@ "pub_date": "2023-05-09T00:00:00Z", "platforms": { "darwin-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVUUXp0NEROL09DaFFTYUVwUy9vanYxM21pVE1zako3R2RGTUZsWEdLVk9DRS8xU21odWo4WHBtK2JWeWtTcVBCek42eXdJK2cxTTJ1RGNzajRCUUJwMjJ2S0lOaTVUdUF3PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjgzNjc2MzI5CWZpbGU6QnJvd3Nlcm5hdXQuYXBwLnRhci5negpIU2lWbWpxbGFKaVNRUUc2cnE2ZlBKRUtkOTh3T3ZzZGVNeG1Fbko5VkNFVmF5UFUzL0tOUXlybjhEQktWYThoZ0NHMFl6dWwwbmZvdTQxY2lZMlhBZz09Cg==", + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVUUXp0NEROL09DaFFiQ2szTnY4RmdEbk54M0c3eElyN3NKd1BLWFNQZUlTRHhkWHhLZSt1UWw0bGxzajczSGlKbFhOeXJTbmRjZWNUdWR3UHlQL1FwcERlRW5WZGRGeVFzPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjgzNzIwMjU3CWZpbGU6QnJvd3Nlcm5hdXQuYXBwLnRhci5negpxSzJ2NTFjUFZBaVBKVFg0akVLMW51dXhjSFZJcDE4WDRvVzI2VVFoQmVQWDdBRzBPNHFYcDV1cnFCNzBuN1NWQk8vR0VSb1NDZVhzRXlPWERkTE1Ddz09Cg==", "url": "https://github.com/billyjacoby/browsernaut/releases/download/0.0.1-dev.13/Browsernaut.app.tar.gz" } }