From c569f08a32bf8a8133048c129aecc9d61a68e225 Mon Sep 17 00:00:00 2001 From: Stypox Date: Sat, 30 Nov 2024 13:10:47 +0100 Subject: [PATCH] Add build-release-apk workflow --- .github/workflows/build-release-apk.yml | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/build-release-apk.yml diff --git a/.github/workflows/build-release-apk.yml b/.github/workflows/build-release-apk.yml new file mode 100644 index 00000000000..9b0f3c97d25 --- /dev/null +++ b/.github/workflows/build-release-apk.yml @@ -0,0 +1,38 @@ +name: "Build unsigned release APK on master" + +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" + 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_v$VERSION_NAME.apk" + + - name: "Upload APK" + uses: actions/upload-artifact@v4 + with: + name: app + path: app/build/outputs/apk/release/*.apk