Skip to content

Commit

Permalink
Merge pull request #3 from OpenShock/cicd-auto-publish
Browse files Browse the repository at this point in the history
Incrementing build number adding release to google play
  • Loading branch information
ImmaCodePrivate authored Oct 2, 2024
2 parents 9f05d07 + 60f58ac commit 9f9d1c4
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release to Google Play

on:
release:
types: [published] # Only triggers when a release is published

jobs:
build_and_upload_android_release:
name: Build and Upload Android Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- uses: subosito/flutter-action@v2
with:
flutter-version: 'stable'

# Install dependencies
- name: Install Flutter dependencies
run: flutter pub get

# Prepare Keystore (decode and save it)
- name: Decode Keystore
run: |
echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 -d > ./android/app/key.jks
# Set up key.properties file
- name: Set up key.properties file
run: |
echo "storePassword=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}" > $GITHUB_WORKSPACE/android/key.properties
echo "keyPassword=${{ secrets.ANDROID_KEY_PASSWORD }}" >> $GITHUB_WORKSPACE/android/key.properties
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" >> $GITHUB_WORKSPACE/android/key.properties
echo "storeFile=key.jks" >> $GITHUB_WORKSPACE/android/key.properties
# Clean previous builds
- name: Clean previous build artifacts
run: flutter clean

# Build release Android App Bundle
- name: Build release AAB
run: flutter build appbundle --release

# Upload the Android App Bundle to Google Play
- name: Upload to Google Play
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: app.openshock.mobile
releaseFiles: build/app/outputs/bundle/release/app-release.aab
debugSymbols: build/app/intermediates/merged_native_libs/release/out/lib
track: production

2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A flutter project.

publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.0.1+3
version: 1.0.1+4

environment:
sdk: '>=3.0.0 <4.0.0'
Expand Down

0 comments on commit 9f9d1c4

Please sign in to comment.