Release update #36
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: Release update | |
on: | |
workflow_dispatch: | |
inputs: | |
jobs: | |
build-release-apk: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Extract version info | |
id: extract-versions | |
run: | | |
set -e | |
VERSION_NAME=$(grep -E 'versionName\s' app/build.gradle.kts | sed -n 's/.*versionName\s*=\s*["'\'']\([^"'\'']*\)["'\''].*/\1/p') | |
VERSION_CODE=$(grep 'versionCode' app/build.gradle.kts | awk '{print $2}') | |
echo "VERSION_NAME=${VERSION_NAME}" >> $GITHUB_ENV | |
echo "VERSION_CODE=${VERSION_CODE}" >> $GITHUB_ENV | |
echo "Version Name: ${VERSION_NAME}" | |
echo "Version Code: ${VERSION_CODE}" | |
- name: Build release APK | |
run: ./gradlew assembleRelease | |
- name: Rename artifact | |
run: mv "app/build/outputs/apk/release/app-release.apk" "SummaryYou-${{ env.VERSION_NAME }}-${{ env.VERSION_CODE }}.apk" | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Release APK | |
path: app/build/outputs/apk/release/SummaryYou-${{ env.VERSION_NAME }}-${{ env.VERSION_CODE }}.apk | |
publish-github-release: | |
runs-on: ubuntu-latest | |
needs: build-release-apk | |
permissions: | |
contents: write | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: Release APK | |
path: artifacts/release-apk | |
- name: Set up environment variables | |
run: | | |
VERSION_NAME=${{ env.VERSION_NAME }} | |
VERSION_CODE=${{ env.VERSION_CODE }} | |
- name: Publish GitHub release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: "v${{ env.VERSION_NAME }}-${{ env.VERSION_CODE }}" | |
prerelease: false | |
draft: true | |
body_path: ${{ github.workspace }}/GITHUB_CHANGELOG.md | |
files: artifacts/release-apk/SummaryYou-${{ env.VERSION_NAME }}-${{ env.VERSION_CODE }}.apk |