Skip to content

Commit

Permalink
Add build-release-apk workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Stypox committed Nov 30, 2024
1 parent 52942ff commit 2f7c9c7
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build-release-apk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Build release APK on master branch"

on:
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: 'master'

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'

- name: "Build release APK"
run: ./gradlew assembleRelease --stacktrace

- name: "Rename APK"
run: |
VERSION_NAME="$(jq -r ".elements[0].versionName" "app/build/outputs/apk/release/output-metadata.json")"
echo "Version name: $VERSION_NAME" >> "$GITHUB_STEP_SUMMARY"
echo '```json' >> "$GITHUB_STEP_SUMMARY"
cat "app/build/outputs/apk/release/output-metadata.json" >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
# assume there is only one APK in that folder
mv "app/build/outputs/apk/release/*.apk" "app/build/outputs/apk/release/NewPipe_$VERSION_NAME.apk"
- name: "Upload APK"
uses: actions/upload-artifact@v4
with:
name: app
path: app/build/outputs/apk/release/*.apk

0 comments on commit 2f7c9c7

Please sign in to comment.