Merge pull request #458 from tusharlock10/main #262
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: Staging Workflow | |
on: | |
push: | |
branches: | |
- develop | |
env: | |
flutter_version: "3.19.3" | |
jobs: | |
build-bundle: | |
name: "build bundle 🛠️" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.PE_PRIVATE_AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.PE_PRIVATE_AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.PE_AWS_REGION }} | |
- name: Download credential files | |
run: | | |
aws s3 cp s3://${{ secrets.PE_PRIVATE_AWS_S3_BUCKET_NAME }}/credentials/client/google-services.json ./android/app/ | |
aws s3 cp s3://${{ secrets.PE_PRIVATE_AWS_S3_BUCKET_NAME }}/credentials/client/upload-keystore.jks ./android/app/ | |
aws s3 cp s3://${{ secrets.PE_PRIVATE_AWS_S3_BUCKET_NAME }}/credentials/client/key.properties ./android/ | |
- name: Install Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
flutter-version: ${{ env.flutter_version }} | |
- name: Get dependencies | |
run: flutter pub get | |
- name: Flutter version | |
run: flutter --version | |
- name: Build bundle | |
run: flutter build appbundle --release --build-number=${{ github.run_number }} | |
# Run the below tasks only if its a push | |
- name: Get release notes | |
if: ${{ github.event_name == 'push' }} | |
run: git log -1 --pretty="STAGING BUILD - Commit %h%n- Date %cs%n- %s" > release_notes.txt | |
- name: Upload bundle to app distribution | |
if: ${{ github.event_name == 'push' }} | |
uses: wzieba/[email protected] | |
with: | |
appId: 1:280154424805:android:06755c7776c617c0aa1b0c | |
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} | |
groups: Developers | |
releaseNotesFile: ./release_notes.txt | |
file: ./build/app/outputs/bundle/release/app-release.aab | |
- name: Upload bundle | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app-release.aab | |
path: ./build/app/outputs/bundle/release/app-release.aab |