|
| 1 | +name: Build APK release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "*" |
| 7 | + |
| 8 | +jobs: |
| 9 | + prepare: |
| 10 | + name: Prepare build environment |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Checkout repository |
| 14 | + uses: actions/checkout@v2 |
| 15 | + with: |
| 16 | + fetch-depth: 0 |
| 17 | + clean: false |
| 18 | + - name: Set executable permissions to gradlew |
| 19 | + run: chmod +x ./gradlew |
| 20 | + - name: Setup JDK 11 |
| 21 | + uses: actions/setup-java@v2 |
| 22 | + with: |
| 23 | + distribution: 'temurin' |
| 24 | + java-version: '11' |
| 25 | + - name: Setup Android SDK |
| 26 | + uses: android-actions/setup-android@v2 |
| 27 | + - name: Get tag name |
| 28 | + id: release |
| 29 | + run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} |
| 30 | + - name: Build APK release |
| 31 | + uses: sparkfabrik/[email protected] |
| 32 | + with: |
| 33 | + project-path: . |
| 34 | + output-path: cloudcutter-${{ steps.release.outputs.tag }}.apk |
| 35 | + build-type: assemble |
| 36 | + - name: Sign build artifacts |
| 37 | + id: sign_app |
| 38 | + uses: r0adkll/sign-android-release@v1 |
| 39 | + with: |
| 40 | + releaseDirectory: . |
| 41 | + signingKeyBase64: ${{ secrets.KEY_STORE }} |
| 42 | + alias: ${{ secrets.KEY_ALIAS }} |
| 43 | + keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} |
| 44 | + keyPassword: ${{ secrets.KEY_ALIAS_PASSWORD }} |
| 45 | + env: |
| 46 | + BUILD_TOOLS_VERSION: "30.0.2" |
| 47 | + - name: Release on GitHub |
| 48 | + uses: softprops/action-gh-release@v1 |
| 49 | + with: |
| 50 | + name: ${{ steps.release.outputs.tag }} |
| 51 | + files: | |
| 52 | + ${{ steps.sign_app.outputs.signedReleaseFile }} |
| 53 | + - name: Upload workflow artifact |
| 54 | + uses: actions/upload-artifact@v2 |
| 55 | + with: |
| 56 | + path: | |
| 57 | + ${{ steps.sign_app.outputs.signedReleaseFile }} |
0 commit comments