Skip to content

Commit 3f3a700

Browse files
committed
Add release workflow
1 parent 214c2d1 commit 3f3a700

File tree

2 files changed

+59
-2
lines changed

2 files changed

+59
-2
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build APK release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
prepare:
10+
name: Prepare build environment
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
clean: false
18+
- name: Set executable permissions to gradlew
19+
run: chmod +x ./gradlew
20+
- name: Setup JDK 11
21+
uses: actions/setup-java@v2
22+
with:
23+
distribution: 'temurin'
24+
java-version: '11'
25+
- name: Setup Android SDK
26+
uses: android-actions/setup-android@v2
27+
- name: Get tag name
28+
id: release
29+
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
30+
- name: Build APK release
31+
uses: sparkfabrik/[email protected]
32+
with:
33+
project-path: .
34+
output-path: cloudcutter-${{ steps.release.outputs.tag }}.apk
35+
build-type: assemble
36+
- name: Sign build artifacts
37+
id: sign_app
38+
uses: r0adkll/sign-android-release@v1
39+
with:
40+
releaseDirectory: .
41+
signingKeyBase64: ${{ secrets.KEY_STORE }}
42+
alias: ${{ secrets.KEY_ALIAS }}
43+
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
44+
keyPassword: ${{ secrets.KEY_ALIAS_PASSWORD }}
45+
env:
46+
BUILD_TOOLS_VERSION: "30.0.2"
47+
- name: Release on GitHub
48+
uses: softprops/action-gh-release@v1
49+
with:
50+
name: ${{ steps.release.outputs.tag }}
51+
files: |
52+
${{ steps.sign_app.outputs.signedReleaseFile }}
53+
- name: Upload workflow artifact
54+
uses: actions/upload-artifact@v2
55+
with:
56+
path: |
57+
${{ steps.sign_app.outputs.signedReleaseFile }}

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ android {
1414
applicationId "io.github.cloudcutter"
1515
minSdk 21
1616
targetSdk 33
17-
versionCode 1
18-
versionName "1.0"
17+
versionCode 10
18+
versionName "0.1.0"
1919
}
2020

2121
buildTypes {

0 commit comments

Comments
 (0)