Create Release #9
This file contains 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: Create Release | |
on: | |
push: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[ci skip]')" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Gradle Wrapper Validation | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "temurin" | |
java-version: 17 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Setup gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Build app | |
run: ./gradlew build | |
env: | |
SIGNING_KEY_FILE: "debug.keystore" | |
SIGNING_KEY_ALIAS: "androiddebugkey" | |
SIGNING_STORE_PASSWORD: "android" | |
SIGNING_KEY_PASSWORD: "android" | |
- name: Set release environment variables | |
if: ${{ github.ref == 'refs/heads/master' }} | |
run: | | |
echo "ARM64_APK_SHA256=$(sha256sum app/build/outputs/apk/release/*-arm64-v8a-release.apk | awk '{ print $1 }')" >> $GITHUB_ENV | |
echo "X86_64_APK_SHA256=$(sha256sum app/build/outputs/apk/release/*-x86_64-release.apk | awk '{ print $1 }')" >> $GITHUB_ENV | |
- name: Set debug environment variables | |
if: ${{ github.ref == 'refs/heads/dev' }} | |
run: | | |
echo "ARM64_APK_SHA256=$(sha256sum app/build/outputs/apk/debug/*-arm64-v8a-debug.apk | awk '{ print $1 }')" >> $GITHUB_ENV | |
echo "X86_64_APK_SHA256=$(sha256sum app/build/outputs/apk/debug/*-x86_64-debug.apk | awk '{ print $1 }')" >> $GITHUB_ENV | |
- name: Upload binaries to a release | |
if: ${{ github.ref == 'refs/heads/master' }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
body: | | |
> ${{ github.event.head_commit.message }} | |
### SHA-256 Checksums of APKs | |
* **arm64-v8a**: `${{ env.ARM64_APK_SHA256 }}` | |
* **x86_64**: `${{ env.X86_64_APK_SHA256 }}` | |
files: | | |
app/build/outputs/apk/release/*.apk | |
tag_name: "${{ github.run_number }}-${{ github.run_id }}" | |
- name: Upload binaries to a pre-release | |
if: ${{ github.ref == 'refs/heads/dev' }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
body: | | |
> ${{ github.event.head_commit.message }} | |
### SHA-256 Checksums of APKs | |
* **arm64-v8a**: `${{ env.ARM64_APK_SHA256 }}` | |
* **x86_64**: `${{ env.X86_64_APK_SHA256 }}` | |
files: | | |
app/build/outputs/apk/release/*.apk | |
tag_name: "${{ github.run_number }}-${{ github.run_id }}" |