Update latest release #15
Workflow file for this run
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: Build and Release APK | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Download keystore file | |
run: echo "${{ secrets.KEYSTORE_FILE_CONTENT }}" | base64 --decode > ${{ github.workspace }}/release.keystore | |
env: | |
KEYSTORE_FILE_CONTENT: ${{ secrets.KEYSTORE_FILE_CONTENT }} | |
- name: Build APK | |
run: ./gradlew assembleRelease | |
env: | |
KEYSTORE_FILE: ${{ github.workspace }}/release.keystore | |
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
- name: List APK files | |
run: ls -la app/build/outputs/apk/release/ | |
- name: Generate release notes | |
run: | | |
latest_tag=$(git describe --tags --abbrev=0) | |
commit_messages=$(git log ${latest_tag}..HEAD --pretty=format:"%s") | |
release_message="Release Notes:\n\n$commit_messages" | |
echo -e "$release_message" > release_notes.txt | |
- name: Create Release from tag | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
body_path: release_notes.txt | |
draft: false | |
prerelease: true | |
- name: Create or Update latest release | |
id: create_latest_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: latest | |
release_name: Latest Release | |
body_path: release_notes.txt | |
draft: false | |
prerelease: true | |
- name: Upload APK | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_latest_release.outputs.upload_url }} | |
asset_path: app/build/outputs/apk/release/app-release.apk | |
asset_name: app-release.apk | |
asset_content_type: application/vnd.android.package-archive |