Skip to content

Commit

Permalink
ci: add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
Bnyro committed Oct 29, 2024
1 parent 63670d0 commit 264158b
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 2 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build and release app

on:
workflow_dispatch:
push:
tags:
- 'v*.*'

jobs:
build:
name: Build, sign and release app
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17"
cache: "gradle"

- name: Build APK
run: ./gradlew assembleRelease --no-daemon

- name: Sign APK
uses: ilharp/sign-android-release@v1
id: sign
with:
signingKey: ${{ secrets.KEYSTORE }}
keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }}
keyStorePassword: ${{ secrets.SIGNING_STORE_PASSWORD }}
keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}

- name: Rename signed APK
run: |
mv "${{ steps.sign.outputs.signedFile }}" "app-release.apk"
- name: Create changelog
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}

- name: Create release
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.changelog.outputs.changes }}
files: "app-release.apk"
fail_on_unmatched_files: true
make_latest: true
Binary file removed app/release/app-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 3,
"versionName": "1.2",
"versionCode": 4,
"versionName": "2.0",
"outputFile": "app-release.apk"
}
],
Expand Down

0 comments on commit 264158b

Please sign in to comment.