Skip to content

[release] v2.2.0

[release] v2.2.0 #52

Workflow file for this run

name: Create Release
on:
push:
tags:
- '*'
jobs:
lint_verify:
name: Lint and verify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Validate Gradle wrapper
uses: gradle/[email protected]
- name: Build Project with Gradle
uses: gradle/gradle-build-action@v2
- name: Lint
run: ./gradlew ktlintCheck
- name: Tests
run: ./gradlew :shared:testReleaseUnitTest
android_release:
name: Build and release android app
runs-on: ubuntu-latest
needs: lint_verify
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Build Project with Gradle
uses: gradle/gradle-build-action@v2
- name: Build Release AAB
id: build_release
run: ./gradlew androidApp:bundleRelease
- name: Sign AAB
id: sign_aab
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: androidApp/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Create release apk path
run: mkdir --parents androidApp/build/outputs/apks/release
- name: Build Release APK
id: build_release_apk
run: |
./gradlew androidApp:assembleRelease
## move to apks/release
mv androidApp/build/outputs/apk/release/*.apk androidApp/build/outputs/apks/release
- name: Build Foss APK
id: build_release_apk_foss
run: |
sh strip_google_services.sh
./gradlew androidApp:assembleRelease
## set appropriate nam, i.e. play-deals-*-release-unsigned.apk -> play-deals-*-release-foss-unsigned.apk
TMP_APK=$(ls androidApp/build/outputs/apk/release/*.apk)
FOSS_APK="${TMP_APK/-release-unsigned/"-release-foss-unsigned"}"
mv $TMP_APK $FOSS_APK
## move to apks/release
mv androidApp/build/outputs/apk/release/*.apk androidApp/build/outputs/apks/release
- name: Upload to google play console
uses: r0adkll/upload-google-play@v1
id: upload_to_play_console
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: me.sujanpoudel.playdeals
releaseFiles: ${{ steps.sign_aab.outputs.signedReleaseFile}}
inAppUpdatePriority: 5
whatsNewDirectory: CHANGELOG/android-whats-new
releaseName: ${{ github.ref_name }}
status: draft
- name: Sign APKs
id: sign_apk
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: androidApp/build/outputs/apks/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Collect Artifacts
id: collect_artifacts
run: |
ARTIFACTS=androidApp/build/outputs/artifacts
mkdir $ARTIFACTS
TMP_APK=$(ls androidApp/build/outputs/apks/release/*-release-unsigned-signed.apk)
RELEASE_APK="${TMP_APK/-release-unsigned-signed/""}"
mv $TMP_APK $RELEASE_APK
mv $RELEASE_APK $ARTIFACTS
TMP_APK=$(ls androidApp/build/outputs/apks/release/*-release-foss-unsigned-signed.apk)
RELEASE_APK="${TMP_APK/-release-foss-unsigned-signed/"-foss"}"
mv $TMP_APK $RELEASE_APK
mv $RELEASE_APK $ARTIFACTS
TMP_BUNDLE=$(ls androidApp/build/outputs/bundle/release/*.aab)
RELEASE_BUNDLE="${TMP_BUNDLE/-release/""}"
mv $TMP_BUNDLE $RELEASE_BUNDLE
mv $RELEASE_BUNDLE $ARTIFACTS
echo "artifacts=$ARTIFACTS" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
with:
name: android-bundles
path: ${{ steps.collect_artifacts.outputs.artifacts }}
desktop_release:
name: Build desktop apps
strategy:
matrix:
os: [ 'ubuntu-latest', 'windows-latest','macos-latest' ]
needs: lint_verify
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Build Project with Gradle
uses: gradle/gradle-build-action@v2
- name: Bundle Package
id: bundle_package
run: |
./gradlew packageDistributionForCurrentOS
echo "package=$(ls desktopApp/build/compose/binaries/main*/*/deals-*-*.*)" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}_bundle
path: ${{ steps.bundle_package.outputs.package }}
github_release:
needs: [ android_release,desktop_release ]
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: downloaded
- name: Collect artifacts
run: |
mkdir artifacts
mv downloaded/**/*.* artifacts/
- name: Extract release notes
id: release_notes
uses: ffurrer2/extract-release-notes@v1
with:
changelog_file: CHANGELOG/CHANGELOG.md
- uses: softprops/action-gh-release@v1
with:
body: ${{ steps.release_notes.outputs.release_notes }}
files: artifacts/*