Skip to content

Commit 88d8d90

Browse files
authored
Merge pull request #11765 from Stypox/release-workflow
Add build-release-apk workflow
2 parents d298a12 + c569f08 commit 88d8d90

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "Build unsigned release APK on master"
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
ref: 'master'
13+
14+
- uses: actions/setup-java@v4
15+
with:
16+
distribution: 'temurin'
17+
java-version: '17'
18+
cache: 'gradle'
19+
20+
- name: "Build release APK"
21+
run: ./gradlew assembleRelease --stacktrace
22+
23+
- name: "Rename APK"
24+
run: |
25+
VERSION_NAME="$(jq -r ".elements[0].versionName" "app/build/outputs/apk/release/output-metadata.json")"
26+
echo "Version name: $VERSION_NAME" >> "$GITHUB_STEP_SUMMARY"
27+
echo '```json' >> "$GITHUB_STEP_SUMMARY"
28+
cat "app/build/outputs/apk/release/output-metadata.json" >> "$GITHUB_STEP_SUMMARY"
29+
echo >> "$GITHUB_STEP_SUMMARY"
30+
echo '```' >> "$GITHUB_STEP_SUMMARY"
31+
# assume there is only one APK in that folder
32+
mv app/build/outputs/apk/release/*.apk "app/build/outputs/apk/release/NewPipe_v$VERSION_NAME.apk"
33+
34+
- name: "Upload APK"
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: app
38+
path: app/build/outputs/apk/release/*.apk

0 commit comments

Comments
 (0)