-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(build) Auto Increment build numbers with tag (#191)
- Loading branch information
1 parent
5aaf2f7
commit b060157
Showing
1 changed file
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: AndroidBuild | ||
name: BuildNative | ||
on: | ||
push: | ||
tags: | ||
|
@@ -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 | ||
|
@@ -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 |