diff --git a/.github/workflows/android_deploy_production.yml b/.github/workflows/android_deploy_production.yml index ee34116c..d127f3ac 100644 --- a/.github/workflows/android_deploy_production.yml +++ b/.github/workflows/android_deploy_production.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - test-lucas jobs: build_and_deploy_android: @@ -15,44 +16,21 @@ jobs: - name: Check out uses: actions/checkout@v3 - - name: Set up Java JDK - uses: actions/setup-java@v3 - with: - distribution: 'adopt' - java-version: '11' + - name: Find HEAD commit + id: head + run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - - name: Set up Flutter environment - uses: subosito/flutter-action@v2 + - name: Build changelog on "main" + id: changelog + uses: mikepenz/release-changelog-builder-action@v4 with: - channel: 'stable' - flutter-version: '3.10.5' - - - name: Generate new project - run: | - dart pub global activate mason_cli - mason get - mason make template -c mason-config.json - - - name: Get Flutter dependencies - run: flutter pub get + configuration: ".github/workflows/changelog-config.json" + # Listing PRs from the last tag to the HEAD commit + toTag: ${{ steps.head.outputs.sha }} + token: ${{ secrets.GITHUB_TOKEN }} - - name: Run code generator - run: flutter packages pub run build_runner build --delete-conflicting-outputs - - - name: Set up .env - env: - ENV: ${{ secrets.ENV }} + - name: Print release notes run: | - echo -e "$ENV" > .env - - # App Bundle requires Firebase connected to Play Store to upload https://appdistribution.page.link/KPoa - - name: Build Android apk - run: flutter build apk --flavor production --debug --build-number $GITHUB_RUN_NUMBER - - - name: Deploy Android Production to Firebase - uses: wzieba/Firebase-Distribution-Github-Action@v1.5.0 - with: - appId: ${{ vars.FIREBASE_ANDROID_APP_ID }} - serviceCredentialsFileContent: ${{ secrets.FIREBASE_DISTRIBUTION_CREDENTIAL_JSON }} - groups: ${{ vars.FIREBASE_DISTRIBUTION_TESTER_GROUPS }} - file: build/app/outputs/flutter-apk/app-production-debug.apk + echo categorized_prs ${{ steps.changelog.outputs.categorized_prs }} + echo uncategorized_prs ${{ steps.changelog.outputs.uncategorized_prs }} + echo "${{ steps.changelog.outputs.changelog }}" diff --git a/.github/workflows/android_deploy_staging.yml b/.github/workflows/android_deploy_staging.yml index f5e68bfd..4c6939d1 100644 --- a/.github/workflows/android_deploy_staging.yml +++ b/.github/workflows/android_deploy_staging.yml @@ -4,6 +4,7 @@ on: push: branches: - develop + - test-lucas jobs: build_and_deploy_android: @@ -15,44 +16,21 @@ jobs: - name: Check out uses: actions/checkout@v3 - - name: Set up Java JDK - uses: actions/setup-java@v3 - with: - distribution: 'adopt' - java-version: '11' + - name: Find HEAD commit + id: head + run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - - name: Set up Flutter environment - uses: subosito/flutter-action@v2 + - name: Build changelog on "develop" + id: changelog + uses: mikepenz/release-changelog-builder-action@v4 with: - channel: 'stable' - flutter-version: '3.10.5' - - - name: Generate new project - run: | - dart pub global activate mason_cli - mason get - mason make template -c mason-config.json - - - name: Get Flutter dependencies - run: flutter pub get + configuration: ".github/workflows/changelog-config.json" + # Listing PRs from the last tag to the HEAD commit + toTag: ${{ steps.head.outputs.sha }} + token: ${{ secrets.GITHUB_TOKEN }} - - name: Run code generator - run: flutter packages pub run build_runner build --delete-conflicting-outputs - - - name: Set up .env.staging - env: - ENV: ${{ secrets.ENV }} + - name: Print release notes run: | - echo -e "$ENV" > .env.staging - - # App Bundle requires Firebase connected to Play Store to upload https://appdistribution.page.link/KPoa - - name: Build Android apk - run: flutter build apk --flavor staging --debug --build-number $GITHUB_RUN_NUMBER - - - name: Deploy Android Staging to Firebase - uses: wzieba/Firebase-Distribution-Github-Action@v1.5.0 - with: - appId: ${{ vars.FIREBASE_ANDROID_APP_ID }} - serviceCredentialsFileContent: ${{ secrets.FIREBASE_DISTRIBUTION_CREDENTIAL_JSON }} - groups: ${{ vars.FIREBASE_DISTRIBUTION_TESTER_GROUPS }} - file: build/app/outputs/flutter-apk/app-staging-debug.apk + echo categorized_prs ${{ steps.changelog.outputs.categorized_prs }} + echo uncategorized_prs ${{ steps.changelog.outputs.uncategorized_prs }} + echo "${{ steps.changelog.outputs.changelog }}" diff --git a/.github/workflows/changelog-config.json b/.github/workflows/changelog-config.json new file mode 100644 index 00000000..9342c48e --- /dev/null +++ b/.github/workflows/changelog-config.json @@ -0,0 +1,31 @@ +{ + "categories": [ + { + "title": "## โœจ Features", + "labels": [ + "type : feature" + ] + }, + { + "title": "## ๐Ÿ› Bug fixes", + "labels": [ + "type : bug" + ] + }, + { + "title": "## ๐Ÿงน Chores", + "labels": [ + "type : chore" + ] + }, + { + "title": "## Others", + "exclude_labels": [ + "type : feature", + "type : bug", + "type : chore", + "type : release" + ] + } + ] +}