Skip to content

Commit

Permalink
chore(build) Auto Increment build numbers with tag (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
WanderingHogan authored Oct 20, 2021
1 parent 5aaf2f7 commit b060157
Showing 1 changed file with 35 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: AndroidBuild
name: BuildNative
on:
push:
tags:
Expand All @@ -10,13 +10,20 @@ jobs:
- name: Checkout the code
uses: actions/checkout@v2
with:
persist-credentials: false
submodules: true ## Installs the android, electron, and locales directory
fetch-depth: 400 ## This fetches entire history, we need this so we can get all the tags
- name: Reconfigure git to use HTTP authentication
run: >
git config --global url."https://github.com/".insteadOf
ssh://[email protected]/
- name: Get Tags/Checkout bug override
run: git fetch --tags --force ## take this out later if https://github.com/actions/checkout/issues/290 is fixed
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV ## Later this is used to update the output files so they have the tag number in the name

- name: Find and Replace Version Numer in Package File ## bumps package version to match ref for the build, will commit to repo at the end when the files are created
run: |
sed -i '' -e 's/\"version\":.*/\"version\": "${{ env.RELEASE_VERSION }}",/g' package.json
- name: Get Current Release Version
run: |
echo $RELEASE_VERSION
Expand Down Expand Up @@ -117,4 +124,29 @@ jobs:
electron/dist/Satellite-${{ env.RELEASE_VERSION }}-arm64-mac.zip
electron/dist/Satellite-Setup-${{ env.RELEASE_VERSION }}.exe
./deduplicated_checksums.txt
body_path: ./deduplicated_checksums.txt
body_path: ./deduplicated_checksums.txt

commit:
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout the code
uses: actions/checkout@v2
with:
ref: main
- name: Set env
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Find and Replace Version Numer in Package File ## bumps package version to match ref for the build, will commit to repo at the end when the files are created
run: |
sed -i -e 's/\"version\":.*/\"version\": "${{ env.RELEASE_VERSION }}",/g' ./package.json
- name: Commit Package.json to Repo
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: Increment Package Version
file_pattern: ./package.json
commit_user_name: Github Actions # defaults to "GitHub Actions"
commit_user_email: [email protected] # defaults to "[email protected]"
commit_author: Github Actions <[email protected]> # defaults to author of the commit that triggered the run

0 comments on commit b060157

Please sign in to comment.