chore(main): release 1.9.0 (#41) #72
This file contains hidden or 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: release-please | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| release-please: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate a token | |
| id: generate-token | |
| uses: actions/create-github-app-token@v3 | |
| with: | |
| app-id: ${{ secrets.CI_GITHUB_APP_APP_ID }} | |
| private-key: ${{ secrets.CI_GITHUB_APP_SECRET }} | |
| - uses: googleapis/release-please-action@v5 | |
| id: release | |
| with: | |
| token: ${{ steps.generate-token.outputs.token }} | |
| release-type: dart | |
| - name: Wait for release PR branch | |
| if: ${{ steps.release.outputs.prs_created == 'true' }} | |
| run: sleep 10 | |
| - name: Resolve release PR branch | |
| id: release-pr | |
| if: ${{ steps.release.outputs.prs_created == 'true' }} | |
| env: | |
| PR_JSON: ${{ steps.release.outputs.pr }} | |
| PRS_JSON: ${{ steps.release.outputs.prs }} | |
| run: | | |
| if [ -n "${PR_JSON}" ]; then | |
| head_branch="$(jq -r '.headBranchName // empty' <<< "${PR_JSON}")" | |
| else | |
| head_branch="$(jq -r '.[0].headBranchName // empty' <<< "${PRS_JSON}")" | |
| fi | |
| if [ -z "${head_branch}" ]; then | |
| echo "Could not resolve release PR branch." | |
| exit 1 | |
| fi | |
| echo "head_branch=${head_branch}" >> "${GITHUB_OUTPUT}" | |
| - uses: actions/checkout@v6 | |
| if: ${{ steps.release.outputs.prs_created == 'true' }} | |
| with: | |
| ref: ${{ steps.release-pr.outputs.head_branch }} | |
| token: ${{ steps.generate-token.outputs.token }} | |
| - uses: dart-lang/setup-dart@v1 | |
| if: ${{ steps.release.outputs.prs_created == 'true' }} | |
| with: | |
| sdk: "3.11.5" | |
| - name: 📦 Install Dependencies | |
| if: ${{ steps.release.outputs.prs_created == 'true' }} | |
| run: | | |
| dart pub get | |
| - name: Run build_runner build | |
| if: ${{ steps.release.outputs.prs_created == 'true' }} | |
| run: | | |
| dart run build_runner build --delete-conflicting-outputs | |
| - name: Commit and push changes (build runner) | |
| if: ${{ steps.release.outputs.prs_created == 'true' }} | |
| env: | |
| TARGET_BRANCH: ${{ steps.release-pr.outputs.head_branch }} | |
| run: | | |
| if [ -z "$(git status --porcelain)" ]; then | |
| echo "No build_runner changes to commit." | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add . | |
| git commit -m "chore: run build_runner build" | |
| git push origin "HEAD:${TARGET_BRANCH}" |