From 13fbf6bb377ada5becd25399b75e9367cbbc4302 Mon Sep 17 00:00:00 2001 From: Soc Sieng Date: Wed, 30 Dec 2020 15:40:44 -0800 Subject: [PATCH] fix(build): update scripts to handle differences in tag_name --- .github/workflows/build.yml | 9 +++++---- scripts/bottle.sh | 6 +++++- scripts/update-version.sh | 2 ++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a2f3e62..a9142c4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -83,7 +83,7 @@ jobs: - id: release uses: GoogleCloudPlatform/release-please-action@v2 with: - token: ${{secrets.GITHUB_TOKEN}} + token: ${{ secrets.GITHUB_TOKEN }} release-type: simple package-name: sendkeys bump-minor-pre-major: true @@ -91,7 +91,8 @@ jobs: - uses: actions/checkout@v2 if: ${{ steps.release.outputs.release_created }} - - name: Create bottle + - id: bottle + name: Create bottle if: ${{ steps.release.outputs.release_created }} run: | ./scripts/update-version.sh ${{ steps.release.outputs.tag_name }} @@ -104,6 +105,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.release.outputs.upload_url }} - asset_path: ./sendkeys--{{ steps.release.outputs.tag_name }}.catalina.bottle.tar.gz - asset_name: sendkeys--{{ steps.release.outputs.tag_name }}.catalina.bottle.tar.gz + asset_path: ./${{ steps.bottle.outputs.bottle }} + asset_name: ${{ steps.bottle.outputs.bottle }} asset_content_type: application/gzip diff --git a/scripts/bottle.sh b/scripts/bottle.sh index d03ac07..d4503bb 100755 --- a/scripts/bottle.sh +++ b/scripts/bottle.sh @@ -8,7 +8,9 @@ version=${1:-`cat $script_folder/../version.txt`} forumula_template=$script_folder/../Formula/sendkeys_template.rb forumula=$script_folder/../Formula/sendkeys.rb url="file://$cwd/sendkeys.tar.gz" -sed_url="$(echo $url | sed 's/\//\\\//g')" +sed_url=`echo $url | sed 's/\//\\\//g'` + +version=`echo $version | sed -E 's/^v//g'` tar zcvf sendkeys.tar.gz --exclude=".git" --exclude=".build" ./ @@ -22,3 +24,5 @@ sed -E -i "" "s/version \"[0-9]+\.[0-9]+\.[0-9]+\"/version \"$version\"/g" $foru brew install --force --build-bottle $forumula brew bottle sendkeys --force-core-tap + +echo ::set-output name=bottle::`ls sendkeys--$version.*.tar.gz` diff --git a/scripts/update-version.sh b/scripts/update-version.sh index 5830dbc..5b34724 100755 --- a/scripts/update-version.sh +++ b/scripts/update-version.sh @@ -6,6 +6,8 @@ cwd=`pwd` script_folder=`cd $(dirname $0) && pwd` version=${1:-`cat $script_folder/../version.txt`} +version=`echo $version | sed -E 's/^v//g'` + echo "updating version to $version" sed -E -i ".bak" "s/version: \"[0-9]+\.[0-9]+\.[0-9]+\" \/\* auto-updated \*\//version: \"$version\" \/\* auto-updated \*\//g" $script_folder/../Sources/SendKeysLib/SendKeysCli.swift