This repository was archived by the owner on Dec 6, 2025. It is now read-only.
Increment version code for new GPlay upload (51c8b8b) #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 App | |
| permissions: | |
| contents: write | |
| packages: read | |
| on: | |
| push: | |
| # Cannot filter on both branches (release) and tags - it's ORed | |
| tags: | |
| - 'v[0-9]+.[0-9]+.[0-9]+' | |
| - 'v[0-9]+.[0-9]+.[0-9]+.[0-9]+' | |
| - 'v[0-9]+.[0-9]+.[0-9]+-rc\.[0-9]+' | |
| - 'v[0-9]+.[0-9]+.[0-9]+-rc\.[0-9]+\.[0-9]+' | |
| - 'v[0-9]+.[0-9]+.[0-9]+-gplay' | |
| - 'v[0-9]+.[0-9]+.[0-9]+.[0-9]+-gplay' | |
| - 'v[0-9]+.[0-9]+.[0-9]+-rc\.[0-9]+-gplay' | |
| - 'v[0-9]+.[0-9]+.[0-9]+-rc\.[0-9]+\.[0-9]+-gplay' | |
| jobs: | |
| release: | |
| name: Release Build and Publish | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/nel0x/syncthing-android-builder | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| fetch-depth: 0 | |
| - name: Ensure release branch | |
| run: | | |
| git config --system --add safe.directory '*' | |
| if ! git branch -a --contains $(git rev-parse HEAD) | grep release >/dev/null; then | |
| echo "Tag is not part of release branch - aborting..." | |
| exit 1 | |
| fi | |
| - name: Get app version from libs.versions.toml | |
| id: get_version | |
| run: | | |
| set -eu | |
| VERSION=$(grep 'version-name = ' gradle/libs.versions.toml | cut -d '"' -f 2) | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| - name: Get commit hash | |
| id: get_commit_hash | |
| run: | | |
| set -eu | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| COMMIT_HASH_LONG="${{ github.event.pull_request.head.sha }}" | |
| else | |
| COMMIT_HASH_LONG="${{ github.sha }}" | |
| fi | |
| COMMIT_HASH_SHORT=$(echo "$COMMIT_HASH_LONG" | cut -c1-7) | |
| echo "COMMIT_HASH=${COMMIT_HASH_SHORT}" >> $GITHUB_ENV | |
| - name: build_release | |
| env: | |
| SYNCTHING_RELEASE_KEY_ALIAS: Syncthing-Fork | |
| SIGNING_PASSWORD: '${{ secrets.SIGNING_PASSWORD }}' | |
| SYNCTHING_RELEASE_STORE_FILE: '${{ runner.temp }}/signing-keystore.jks' | |
| shell: bash | |
| run: | | |
| set -eu | |
| echo '${{ secrets.SIGNING_KEYSTORE_JKS_BASE64 }}' | base64 -d > "$SYNCTHING_RELEASE_STORE_FILE" | |
| java -version | |
| ./gradlew --no-daemon buildNative lintRelease assembleRelease bundlegplay | |
| rm "$SYNCTHING_RELEASE_STORE_FILE" | |
| - name: prepare-artifacts | |
| shell: bash | |
| run: | | |
| set -eu | |
| # | |
| mv "app/build/outputs/apk/release/app-release.apk" "app/build/outputs/apk/release/com.github.catfriend1.syncthingandroid_release_v${{ env.VERSION }}_${{ env.COMMIT_HASH }}.apk" | |
| mv "app/build/outputs/bundle/gplay/app-gplay.aab" "app/build/outputs/bundle/gplay/com.github.catfriend1.syncthingandroid_gplay_v${{ env.VERSION }}_${{ env.COMMIT_HASH }}.aab" | |
| # | |
| cd "app/build/outputs/apk/release" | |
| - uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: "app/build/outputs/apk/release/*.apk,app/build/outputs/bundle/gplay/*.aab" | |
| artifactErrorsFailBuild: true | |
| name: Syncthing-Fork v${{ env.VERSION }} | |
| bodyFile: "app/src/main/play/release-notes/en-US/default.txt" | |
| prerelease: ${{ contains('-rc.', github.ref_name) }} | |
| draft: true |