From a18867cbaa9bf1526b3a91f96d569c44f37e9d2b Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Sun, 11 Feb 2024 21:20:00 -0500 Subject: [PATCH] feat: Add Forgejo Actions workflow * Build debug artifacts for both EasyEUICC and OpenEUICC at every commit on master. * Release EasyEUICC apk when a tag is created. No OpenEUICC release will be uploaded. --- .forgejo/workflows/build-debug.yml | 44 +++++++++++++++++++++++++++ .forgejo/workflows/release.yml | 49 ++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 .forgejo/workflows/build-debug.yml create mode 100644 .forgejo/workflows/release.yml diff --git a/.forgejo/workflows/build-debug.yml b/.forgejo/workflows/build-debug.yml new file mode 100644 index 0000000..4a55880 --- /dev/null +++ b/.forgejo/workflows/build-debug.yml @@ -0,0 +1,44 @@ +on: + push: + branches: + - 'master' + +jobs: + build-debug: + runs-on: docker + container: + volumes: + - android-app-keystore:/keystore + steps: + - name: Repository Checkout + uses: https://gitea.angry.im/actions/checkout@v3 + with: + submodules: recursive + + - name: Decode Secret Signing Configuration + uses: https://gitea.angry.im/actions/base64-to-file@v1 + with: + fileName: keystore.properties + fileDir: ${{ env.GITHUB_WORKSPACE }} + encodedString: ${{ secrets.OPENEUICC_SIGNING_CONFIG }} + + - name: Set up JDK 17 + uses: https://gitea.angry.im/actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: Setup Android SDK + uses: https://gitea.angry.im/actions/setup-android@v3 + + - name: Build Debug APKs + run: ./gradlew --no-daemon assembleDebug + + - name: Upload Artifacts + uses: https://gitea.angry.im/actions/upload-artifact@v3 + with: + name: Debug APKs + compression-level: 0 + path: | + app-unpriv/build/outputs/apk/debug/app-unpriv-debug.apk + app/build/outputs/apk/debug/app-debug.apk diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml new file mode 100644 index 0000000..d16f9e5 --- /dev/null +++ b/.forgejo/workflows/release.yml @@ -0,0 +1,49 @@ +on: + push: + tags: '*' + +env: + # Enable reproducibility-related build system workarounds + REPRODUCIBLE_BUILD: true + +jobs: + release: + runs-on: docker + container: + volumes: + - android-app-keystore:/keystore + steps: + - name: Repository Checkout + uses: https://gitea.angry.im/actions/checkout@v3 + with: + submodules: recursive + + - name: Decode Secret Signing Configuration + uses: https://gitea.angry.im/actions/base64-to-file@v1 + with: + fileName: keystore.properties + fileDir: ${{ env.GITHUB_WORKSPACE }} + encodedString: ${{ secrets.OPENEUICC_SIGNING_CONFIG }} + + - name: Set up JDK 17 + uses: https://gitea.angry.im/actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: Setup Android SDK + uses: https://gitea.angry.im/actions/setup-android@v3 + + - name: Build Release APK (Unprivileged / EasyEUICC only) + run: ./gradlew --no-daemon :app-unpriv:assembleRelease + + - name: Create Release + uses: https://gitea.angry.im/actions/forgejo-release@v1 + with: + direction: upload + release-dir: app-unpriv/build/outputs/apk/release + url: https://gitea.angry.im + token: ${{ secrets.FORGEJO_TOKEN }} + # Release details are expected to be edited manually + release-notes: TBD + prerelease: 'true'