name: Upload Release APK on: push: tags: - 'v*.*.*' jobs: check: runs-on: ubuntu-latest outputs: match: ${{ steps.check-tag.outputs.match }} steps: - id: check-tag run: | if [[ "${{ github.event.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then echo ::set-output name=match::true fi build: needs: check if: needs.check.outputs.match == 'true' name: Upload Release APK runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: recursive - uses: Swatinem/rust-cache@v2 with: working-directory: jni/deltachat-core-rust - uses: actions/setup-java@v3 with: java-version: 17 distribution: 'temurin' - uses: android-actions/setup-android@v3 - uses: nttld/setup-ndk@v1 id: setup-ndk with: ndk-version: r27 - name: Compile core env: ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }} run: | export PATH="${PATH}:${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin/:${ANDROID_NDK_ROOT}" ./scripts/install-toolchains.sh && ./scripts/ndk-make.sh - name: Build APK run: | mkdir -p ~/.gradle echo -n ${{ secrets.KEYSTORE_FILE }} | base64 -d >> ~/keystore.jks echo "DC_RELEASE_STORE_FILE=$HOME/keystore.jks" >> ~/.gradle/gradle.properties echo "DC_RELEASE_STORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }}" >> ~/.gradle/gradle.properties echo "DC_RELEASE_KEY_ALIAS_FDROID=${{ secrets.ALIAS_FDROID }}" >> ~/.gradle/gradle.properties echo "DC_RELEASE_KEY_ALIAS_GPLAY=${{ secrets.ALIAS_GPLAY }}" >> ~/.gradle/gradle.properties echo "DC_RELEASE_KEY_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }}" >> ~/.gradle/gradle.properties ./gradlew assembleFossRelease rm build/outputs/apk/foss/release/*universal* ./gradlew assembleGplayRelease mv build/outputs/apk/gplay/release/*universal* build/outputs/apk/foss/release/ArcaneChat-gplay.apk - name: Release on GitHub uses: softprops/action-gh-release@v1 with: token: "${{ secrets.GITHUB_TOKEN }}" body: '[Get it on Google Play](https://play.google.com/store/apps/details?id=com.github.arcanechat) [Get it on F-Droid](https://f-droid.org/packages/chat.delta.lite) [Get it on GitHub](https://github.com/ArcaneChat/android/releases/latest/download/ArcaneChat-gplay.apk)' prerelease: ${{ contains(github.event.ref, '-beta') }} fail_on_unmatched_files: true files: build/outputs/apk/foss/release/*.apk - name: Release on ZapStore run: | export CHECKSUM=6e2c7cf6da53c3f1a78b523a6aacd6316dce3d74ace6f859c2676729ee439990 curl -sL https://cdn.zapstore.dev/$CHECKSUM -o zapstore if echo "$CHECKSUM zapstore" | sha256sum -c --status; then chmod +x zapstore SIGN_WITH=${{ secrets.NOSTR_KEY }} ./zapstore publish --indexer-mode else echo "ERROR: checksum doesn't match!" fi