Merge pull request #156 from NateEaton/chore/prepare-v0.13.0 #13
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Build and Github Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true' | |
| jobs: | |
| build-and-sign: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Decode Keystore | |
| run: | | |
| echo "${{ secrets.SIGNING_KEY }}" | base64 --decode > ${{ github.workspace }}/keystore.jks | |
| # Release APKs are intentionally secure by default: | |
| # - HTTPS only | |
| # - system CA trust only | |
| # | |
| # Self-hosters who need a custom less-secure release can opt in at build time | |
| # by setting one or both environment variables below on the Gradle step. | |
| # | |
| # When you might need this: | |
| # - ALLOW_INSECURE_HTTP_RELEASE=true | |
| # Example: your Readeck server is only reachable on a trusted local network | |
| # over plain HTTP, such as http://192.168.1.50:8000, and you do not have TLS | |
| # configured for that host. | |
| # | |
| # - ALLOW_USER_CA_RELEASE=true | |
| # Example: your Readeck server uses HTTPS, but its certificate chains to a | |
| # private or user-installed CA rather than a public system-trusted CA. | |
| # | |
| # To build such a custom release in GitHub Actions, add one or both of these | |
| # env vars under the Gradle step: | |
| # | |
| # ALLOW_INSECURE_HTTP_RELEASE: 'true' | |
| # ALLOW_USER_CA_RELEASE: 'true' | |
| # | |
| # Do not enable these for official/public releases unless you explicitly want | |
| # the APK to trust weaker transport settings. | |
| - name: Build and Sign Release APK | |
| run: ./gradlew assembleGithubReleaseRelease | |
| env: | |
| KEY_ALIAS: ${{ secrets.ALIAS }} | |
| KEYSTORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| KEYSTORE: ${{ github.workspace }}/keystore.jks | |
| - name: Get Version from Tag | |
| id: get_version | |
| run: echo "version=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT | |
| - name: Upload APK to GitHub Release Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-release-${{ steps.get_version.outputs.version }} | |
| path: app/build/outputs/apk/githubRelease/release/*.apk | |
| create-release: | |
| needs: build-and-sign | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get Version from Tag | |
| id: get_version | |
| run: echo "version=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT | |
| - name: Download Release Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: app-release-${{ steps.get_version.outputs.version }} | |
| path: ./artifacts # Download to a dedicated directory | |
| - name: Create Release | |
| id: create_release | |
| uses: ncipollo/release-action@v1.16.0 | |
| with: | |
| allowUpdates: false | |
| prerelease: true | |
| draft: true | |
| name: MyDeck Release v${{ steps.get_version.outputs.version }} | |
| tag: ${{ github.ref }} | |
| artifacts: "./artifacts/*.apk" | |
| token: ${{ secrets.GITHUB_TOKEN }} |