-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* CI setup * ci check for main branch
- Loading branch information
Showing
7 changed files
with
205 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
name: Create Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
jobs: | ||
lint_verify: | ||
name: Lint and verify | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Exit if not on main branch | ||
if: endsWith(github.ref, 'main') == false | ||
run: exit -1 | ||
|
||
- 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 | ||
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 }} | ||
|
||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
➤ Minor Bug Fixes |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile | ||
|
||
-dontwarn org.slf4j.impl.StaticLoggerBinder |
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
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