Skip to content

Commit

Permalink
fix(build): update scripts to handle differences in tag_name
Browse files Browse the repository at this point in the history
  • Loading branch information
socsieng committed Dec 30, 2020
1 parent 64ced82 commit 13fbf6b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Expand Up @@ -83,15 +83,16 @@ 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

- 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 }}
Expand All @@ -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
6 changes: 5 additions & 1 deletion scripts/bottle.sh
Expand Up @@ -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" ./

Expand All @@ -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`
2 changes: 2 additions & 0 deletions scripts/update-version.sh
Expand Up @@ -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

0 comments on commit 13fbf6b

Please sign in to comment.