Skip to content

Commit 4bf2862

Browse files
committed
Add gh_akp_release.yaml
1 parent a63491e commit 4bf2862

2 files changed

Lines changed: 54 additions & 0 deletions

File tree

.github/signing_setup.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
# taken from https://github.com/PaulWoitaschek/Voice/blob/main/ci_signing_setup.sh
4+
decode_env_to_file() {
5+
local env_var="${1}"
6+
local dest_file="${2}"
7+
if [[ -n "${!env_var}" ]]; then
8+
if [[ ! -f "${dest_file}" ]]; then
9+
echo "${!env_var}" | base64 --decode >"${dest_file}"
10+
echo "Success: Written to ${dest_file}"
11+
else
12+
echo "Warning: File ${dest_file} already exists, not overwritten."
13+
fi
14+
else
15+
echo "Warning: Environment variable ${env_var} is empty or not set, no action taken."
16+
fi
17+
}
18+
19+
decode_env_to_file "SIGNING_KEYSTORE" "../keys.jks"
20+
decode_env_to_file "SIGNING_PROPERTIES" "../keys.properties"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
on: workflow_dispatch
2+
3+
env:
4+
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -XX:MaxMetaspaceSize=1g -Xms512m -XX:+HeapDumpOnOutOfMemoryError"
5+
SIGNING_KEYSTORE_PLAY: ${{ secrets.SIGNING_KEYSTORE }}
6+
SIGNING_PROPERTIES_PLAY: ${{ secrets.SIGNING_PROPERTIES }}
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Setup JDK
15+
uses: actions/setup-java@v4
16+
with:
17+
java-version: 17
18+
distribution: temurin
19+
20+
- name: Setup Signing
21+
run: .github/signing_setup.sh
22+
23+
- name: Build release APK
24+
run: ./gradlew assembleRelease
25+
26+
- name: Extract version from gradle.properties
27+
id: version
28+
run: echo "VERSION=$(grep -Po '^version=\K.*' gradle.properties)" >> $GITHUB_OUTPUT
29+
30+
- name: Create Github Release
31+
uses: softprops/action-gh-release@v1
32+
with:
33+
tag_name: ${{ steps.version.outputs.VERSION }}
34+
files: app/build/outputs/apk/release/${{ steps.version.outputs.VERSION }}.apk

0 commit comments

Comments
 (0)