Skip to content

Release update

Release update #33

Workflow file for this run

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 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