Generate Release #42
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: Generate Release | |
on: | |
push: | |
tags: | |
- "v*" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: gradle/wrapper-validation-action@v1 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'gradle' | |
- run: chmod +x gradlew | |
- name: Build release | |
id: build_release | |
run: | | |
echo "${{ secrets.ANDROID_SIGNATURE }}" > signature.jks.asc | |
gpg -d --batch --passphrase ${{ secrets.ANDROID_SIGNATURE_PASS }} signature.jks.asc > signature.jks | |
export signing_storeFile=$(pwd)/signature.jks | |
export signing_storePassword=${{ secrets.ANDROID_SIGNATURE_STORE_PASS }} | |
export signing_keyAlias=${{ secrets.ANDROID_SIGNATURE_KEY }} | |
export signing_keyPassword=${{ secrets.ANDROID_SIGNATURE_KEY_PASS }} | |
./gradlew clean | |
./gradlew assembleRelease -x check | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: RTCalculator-${{github.ref_name}} | |
path: app/build/outputs/apk/*/release/*.apk | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
if: ${{ github.event_name == 'push' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v3 | |
- name: Extract changelog | |
id: extract_changelog | |
run: | | |
changelog=$(sed -n "/^$GITHUB_REF_NAME/,/^v/p" settings/src/androidMain/res/raw/changelog.txt | head -n -2) | |
echo 'CHANGELOG<<EOF' >> $GITHUB_ENV | |
echo "$changelog" >> $GITHUB_ENV | |
echo 'EOF' >> $GITHUB_ENV | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
with: | |
body: | | |
## Changelog | |
### ${{ env.CHANGELOG }} | |
artifacts: "**/*.apk" | |
artifactErrorsFailBuild: true |