Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
imsodin committed Jul 15, 2023
1 parent 343f343 commit 98a7159
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: App

on:
pull_request:
push:
branches:
- release
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-rc[0-9.]+'

env:
# Our build metadata
Expand Down Expand Up @@ -35,3 +41,46 @@ jobs:
path: |
app/build/reports/**
app/src/main/jniLibs/**
release:
name: Release Build and Publish
if: github.event_name == 'push'
runs-on: ubuntu-latest
container: ghcr.io/syncthing/syncthing-android-builder
steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: build
env:
SYNCTHING_RELEASE_KEY_ALIAS: android
SIGNING_PASSWORD: '${{ secrets.SIGNING_PASSWORD }}'
SYNCTHING_RELEASE_STORE_FILE: '${{ RUNNER_TEMP }}/signing-keystore.jks'
SYNCTHING_RELEASE_PLAY_ACCOUNT_CONFIG_FILE: '${{ RUNNER_TEMP }}/google-play-secrets.json'
shell: bash # main purpose: enables -eo pipefail
run: |
echo "$SIGNING_KEYSTORE_JKS_BASE64" | base64 -d > "$SYNCTHING_RELEASE_STORE_FILE"
echo "$GOOGLE_PLAY_SECRETS_BASE64" | base64 -d > "$SYNCTHING_RELEASE_PLAY_ACCOUNT_CONFIG_FILE"
java -version
./gradlew --no-daemon buildNative lint assembleRelease publishReleaseApps
rm "$SYNCTHING_RELEASE_STORE_FILE" "$SYNCTHING_RELEASE_PLAY_ACCOUNT_CONFIG_FILE"
echo "$GNUPG_SIGNING_KEY_BASE64" | base64 -d | gpg --import
cd app/build/outputs/apk/release
sha256sum app-release.apk | gpg --clearsign > sha256sum.txt.asc
- uses: actions/upload-artifact@v3
with:
name: release
path: |
app/build/outputs/apk/release/*.apk
app/build/outputs/apk/release/*.asc
- uses: ncipollo/release-action@v1
with:
artifacts: "app/build/outputs/apk/release/*.apk,app/build/outputs/apk/release/*.asc"
artifactErrorsFailBuild: true
bodyFile: "app/src/main/play/release-notes/en-GB/default.txt"
prerelease: ${{ contains('-rc.', github.ref_name) }}
draft: true

0 comments on commit 98a7159

Please sign in to comment.