diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6518bb0f8f..1337fe676f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -628,7 +628,7 @@ jobs: node ../common/scripts/install-run-rushx.js dist --linux --windows --x64 node ../common/scripts/install-run-rushx.js dist-signed --macos --x64 --arm64 ./scripts/copy-publish-artifacts.sh ${{ env.PublishTempFolder}} - - name: Publish distribution assets + - name: Publish distribution assets and version uses: ryand56/r2-upload-action@latest with: r2-account-id: ${{ secrets.R2_ACCOUNT_ID }} @@ -637,12 +637,6 @@ jobs: r2-bucket: desktop-distro source-dir: desktop-package/${{ env.PublishTempFolder}} destination-dir: ./ - - name: Publish distribution version - env: - AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} - run: | - ./desktop-package/scripts/publish-version.sh - name: Upload MacOS uses: actions/upload-artifact@v4 with: diff --git a/desktop-package/scripts/copy-publish-artifacts.sh b/desktop-package/scripts/copy-publish-artifacts.sh index d35f0554c9..90f3dd26d8 100755 --- a/desktop-package/scripts/copy-publish-artifacts.sh +++ b/desktop-package/scripts/copy-publish-artifacts.sh @@ -3,6 +3,7 @@ SRC_FOLDER=deploy TARGET_FOLDER=$1 CHANNEL=latest +set -e if [ -d "$TARGET_FOLDER" ]; then rm -Rf $TARGET_FOLDER; fi mkdir $TARGET_FOLDER @@ -15,3 +16,11 @@ cp $SRC_FOLDER/*.exe $TARGET_FOLDER cp $SRC_FOLDER/$CHANNEL.yml $TARGET_FOLDER cp $SRC_FOLDER/$CHANNEL-mac.yml $TARGET_FOLDER cp $SRC_FOLDER/$CHANNEL-linux.yml $TARGET_FOLDER + +# Create version-specific description files +rawVersion=$(node ../common/scripts/show_tag.js) +version=${rawVersion:1:${#rawVersion}-2} + +cp $SRC_FOLDER/$CHANNEL.yml $TARGET_FOLDER/${version}.yml +cp $SRC_FOLDER/$CHANNEL-mac.yml $TARGET_FOLDER/${version}-mac.yml +cp $SRC_FOLDER/$CHANNEL-linux.yml $TARGET_FOLDER/${version}-linux.yml diff --git a/desktop-package/scripts/publish-version.sh b/desktop-package/scripts/publish-version.sh deleted file mode 100755 index d0160c82c1..0000000000 --- a/desktop-package/scripts/publish-version.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -endpoint=https://47fadbaa4ecbea9f3e8b7043a4584e27.r2.cloudflarestorage.com -bucket=desktop-distro -rawVersion=$(node common/scripts/show_tag.js) -version=${rawVersion:1:${#rawVersion}-2} - -cd desktop-package/deploy - -aws s3api put-object --endpoint $endpoint --bucket $bucket --key ${version}-mac.yml --body latest-mac.yml --acl public-read 2>&1 > /dev/null -if [ $? -ne 0 ]; then - echo "Error uploading ${version}-mac.yml" >&2 - exit 1 -fi - -aws s3api put-object --endpoint $endpoint --bucket $bucket --key ${version}-linux.yml --body latest-linux.yml --acl public-read 2>&1 > /dev/null -if [ $? -ne 0 ]; then - echo "Error uploading ${version}-linux.yml" >&2 - exit 1 -fi - -aws s3api put-object --endpoint $endpoint --bucket $bucket --key ${version}.yml --body latest.yml --acl public-read 2>&1 > /dev/null -if [ $? -ne 0 ]; then - echo "Error uploading ${version}.yml" >&2 - exit 1 -fi - -echo Successfully published version ${version} to ${endpoint}/${bucket}