Release update #31
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: | | |
VERSION_NAME=$(cat app/build.gradle | grep "versionName" | sed -En 's/.*"(.+)".*/\1/p') | |
VERSION_CODE=$(cat app/build.gradle | grep "versionCode" | awk '{print $2}') | |
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV | |
echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV | |
- name: Build release APK | |
run: ./gradlew assembleLawnWithQuickstepRelease | |
- name: Rename artifact | |
run: mv "build/outputs/apk/lawnWithQuickstep/release/app-release.apk" "ReleaseAPK-${{ env.VERSION_NAME }}-${{ env.VERSION_CODE }}.apk" | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Release APK | |
path: "ReleaseAPK-${{ 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/ReleaseAPK-${{ env.VERSION_NAME }}-${{ env.VERSION_CODE }}.apk |