ci(release): fix melos release automation with scoped publishing (#1316) #39
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: Create Release Tags | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| actions: write | |
| jobs: | |
| create-tags: | |
| if: ${{ contains(github.event.head_commit.message, 'chore(release):') }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Generate token | |
| id: app-token | |
| uses: actions/create-github-app-token@v2 | |
| with: | |
| app-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.PRIVATE_KEY }} | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| cache: true | |
| - name: Setup Melos | |
| uses: bluefireteam/melos-action@v3 | |
| with: | |
| tag: true | |
| - name: Trigger publish workflows | |
| run: | | |
| melos exec -c 1 --no-published --no-private --order-dependents -- \ | |
| bash -c "gh workflow run release-publish.yml \ | |
| --ref \$MELOS_PACKAGE_NAME-v\$MELOS_PACKAGE_VERSION \ | |
| --field package-name=\$MELOS_PACKAGE_NAME \ | |
| --field package-version=\$MELOS_PACKAGE_VERSION && \ | |
| sleep 30" | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} |