chore: set bootstrap-sha #4
Workflow file for this run
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 | |
| - chore/setup-release-please | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| release-please: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| releases_created: ${{ steps.release.outputs.releases_created }} | |
| paths_released: ${{ steps.release.outputs.paths_released }} | |
| steps: | |
| - name: Release Please | |
| id: release | |
| uses: googleapis/release-please-action@v4 | |
| with: | |
| target-branch: ${{ github.ref_name }} | |
| config-file: release-please-config.json | |
| manifest-file: .release-please-manifest.json | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| publish: | |
| needs: release-please | |
| if: needs.release-please.outputs.releases_created == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Dart | |
| uses: dart-lang/setup-dart@v1 | |
| with: | |
| sdk: stable | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: 'stable' | |
| channel: 'stable' | |
| - name: Get Dart dependencies | |
| run: dart pub global activate melos | |
| - name: Bootstrap workspace | |
| run: melos bootstrap | |
| # - name: Run version update hook | |
| # run: melos run update-version | |
| # - name: Run tests | |
| # run: melos run test --no-select | |
| - name: Setup pub credentials | |
| run: | | |
| mkdir -p ~/.config/dart | |
| cat <<EOF > ~/.config/dart/pub-credentials.json | |
| { | |
| "accessToken":"${{ secrets.PUB_DEV_ACCESS_TOKEN }}", | |
| "refreshToken":"${{ secrets.PUB_DEV_REFRESH_TOKEN }}", | |
| "tokenEndpoint":"https://accounts.google.com/o/oauth2/token", | |
| "scopes":["https://www.googleapis.com/auth/userinfo.email","openid"], | |
| "expiration":${{ secrets.PUB_DEV_TOKEN_EXPIRATION }} | |
| } | |
| EOF | |
| - name: Publish packages | |
| run: | | |
| # Parse the released paths and publish each package | |
| echo '${{ needs.release-please.outputs.paths_released }}' | jq -r '.[]' | while read -r path; do | |
| echo "Publishing package in $path" | |
| cd "$path" | |
| if [ -f "pubspec.yaml" ]; then | |
| dart pub publish --force | |
| fi | |
| cd - > /dev/null | |
| done |