develop -> main[release] v2.0.1 #29 #36
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: 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 and apk | |
id: build_release | |
run: ./gradlew androidApp:assembleRelease 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: 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 | |
changesNotSentForReview: true | |
releaseName: ${{ github.event.head_commit.message }} | |
status: draft | |
- name: Sign APK | |
id: sign_apk | |
uses: r0adkll/sign-android-release@v1 | |
with: | |
releaseDirectory: androidApp/build/outputs/apk/release | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: android-bundles | |
path: | | |
${{ steps.sign_aab.outputs.signedReleaseFile}} | |
${{ steps.sign_apk.outputs.signedReleaseFile}} | |
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/download-artifact@v3 | |
with: | |
path: downloaded | |
- name: Collect artifacts | |
run: | | |
mkdir artifacts | |
TMP_APK=$(ls downloaded/android-bundles/apk/release/*.apk) | |
SIGNED_APK="${TMP_APK/-release-unsigned-signed/""}" | |
mv $TMP_APK $SIGNED_APK | |
mv downloaded/android-bundles/apk/release/* artifacts/ | |
mv downloaded/android-bundles/bundle/release/* artifacts/ | |
mv downloaded/**/*.* artifacts/ | |
echo "ARTIFACTS=$(ls artifacts/*)" >> "$GITHUB_ENV" | |
- uses: softprops/action-gh-release@v1 | |
with: | |
body_path: CHANGELOG/whatsnew-en-US | |
files: ${{ env.ARTIFACTS }} | |