-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generate release when a new tag is pushed
resolves #290
- Loading branch information
1 parent
87754cf
commit 9f5720c
Showing
3 changed files
with
56 additions
and
4 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
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
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Generates and uploads a release version when a new tag is pushed | ||
name: Create release | ||
|
||
on: | ||
# trigger for tags starting with 'v' | ||
push: | ||
tags: | ||
- v* | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get the repository files | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Setup gradle | ||
uses: gradle/actions/setup-gradle@v4 | ||
|
||
- name: Create release store file | ||
run: | | ||
RELEASE_STORE_FILE=$(readlink -f release_store_file) | ||
echo -n "$RELEASE_STORE_FILE_ENCRYPTED" | base64 --decode > $RELEASE_STORE_FILE | ||
echo "RELEASE_STORE_FILE=$RELEASE_STORE_FILE" >> "$GITHUB_ENV" | ||
env: | ||
RELEASE_STORE_FILE_ENCRYPTED: ${{ secrets.RELEASE_STORE_FILE }} | ||
|
||
- name: Build & assemble | ||
run: ./gradlew build assembleRelease | ||
env: | ||
RELEASE_STORE_PASSWORD: ${{ secrets.RELEASE_STORE_PASSWORD }} | ||
RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }} | ||
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} | ||
|
||
- name: Upload apk to release with the release notes | ||
run: > | ||
sed '/^$/q' ./app/src/main/play/release-notes/en-US/default.txt | ||
| | ||
gh release create $TAG | ||
./app/build/outputs/apk/release/*.apk | ||
--title="URLCheck ${TAG#v} release apk" | ||
--notes-file - | ||
--latest | ||
--verify-tag | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TAG: ${{ github.ref_name }} |