Skip to content

Commit 99fc24c

Browse files
[workflows] add tag releases, and match pre-release if beta.
1 parent 2b7aa44 commit 99fc24c

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

‎.github/workflows/android-release-build.yml‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ name: Build and Sign IIAB APKs
33
on:
44
push:
55
branches: [ "main", "master" ]
6+
tags:
7+
- 'v*'
68
workflow_dispatch:
79

810
jobs:
911
build:
1012
name: Build Release APKs
1113
runs-on: ubuntu-latest
14+
1215
defaults:
1316
run:
1417
working-directory: ./controller
@@ -44,7 +47,7 @@ jobs:
4447
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
4548
# Run assembleRelease injecting the signature, skipping store.properties
4649
run: |
47-
./gradlew assembleRelease --info \
50+
./gradlew assembleRelease \
4851
-Pandroid.injected.signing.store.file=$(pwd)/keystore.jks \
4952
-Pandroid.injected.signing.store.password=$KEYSTORE_PASSWORD \
5053
-Pandroid.injected.signing.key.alias=$KEY_ALIAS \
@@ -58,6 +61,18 @@ jobs:
5861
path: controller/**/build/outputs/apk/release/*.apk
5962
retention-days: 7
6063

64+
# Only if this pipeline was triggered by a Tag, we create the Release
65+
- name: Create GitHub Release
66+
if: startsWith(github.ref, 'refs/tags/v')
67+
uses: softprops/action-gh-release@v2
68+
with:
69+
# Automatically marks the version as Pre-release if your tag ends in "-beta" or "-rc"
70+
prerelease: ${{ contains(github.ref, '-beta') || contains(github.ref, '-rc') }}
71+
files: controller/**/build/outputs/apk/release/*.apk
72+
generate_release_notes: true
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
6176
- name: Cleanup Keystore
6277
if: always()
6378
run: rm -f keystore.jks

0 commit comments

Comments
 (0)