mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-14 08:41:28 +00:00
add update-latest-version job to post-publish
This commit is contained in:
40
.github/workflows/post-publish.yml
vendored
40
.github/workflows/post-publish.yml
vendored
@@ -109,3 +109,43 @@ jobs:
|
||||
token: ${{ secrets.CRYPTOBOT_WORKFLOW_DISPATCH_TOKEN }}
|
||||
repository: cryptomator/docs
|
||||
client-payload: '{ "version": "${{needs.get-version.outputs.semVerStr}}", "release": ${{ toJson(github.event.release.assets) }} }'
|
||||
|
||||
update-latest-version:
|
||||
needs: [get-version]
|
||||
runs-on: ubuntu-latest
|
||||
if: needs.get-version.outputs.versionType == 'stable'
|
||||
steps:
|
||||
- name: Download
|
||||
run: >
|
||||
curl --silent --fail-with-body --proto "=https"
|
||||
-L -H "Accept: application/json"
|
||||
https://static.cryptomator.org/desktop/latest-version.json
|
||||
--output latest-version.json
|
||||
- name: Update
|
||||
run: |
|
||||
update_entry() {
|
||||
local os="$1"
|
||||
local file_extension="$2"
|
||||
|
||||
local url=$(jq -r --arg file_extension "$file_extension" '[.[] | select(.name | endswith($file_extension))][0].browser_download_url // "null"' <<< "$RELEASE_ASSETS")
|
||||
if [[ "$url" != "null" && -n "$url" ]]; then
|
||||
jq -r --arg os_key "$os" '.[$os_key] = env.NEW_VERSION' latest-version.json > INPUT.tmp
|
||||
mv INPUT.tmp latest-version.json
|
||||
fi
|
||||
}
|
||||
|
||||
update_entry "win" ".msi"
|
||||
update_entry "mac" ".dmg"
|
||||
update_entry "linux" ".AppImage"
|
||||
env:
|
||||
RELEASE_ASSETS: ${{ toJson(github.event.release.assets) }}
|
||||
NEW_VERSION: ${{ needs.get-version.outputs.semVerStr }}
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@v4
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
aws-region: ${{ vars.AWS_REGION || 'nl-ams' }}
|
||||
- name: Upload
|
||||
run: aws s3 cp latest-version.json s3://static.cryptomator.org/desktop/latest-version.json --endpoint-url https://s3.nl-ams.scw.cloud/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user