chore: remove condition: #9
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 }} | |
| pr_created: ${{ steps.release.outputs.pr_created }} | |
| pr_number: ${{ steps.release.outputs.pr_number }} | |
| 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 }} | |
| update-dependencies: | |
| needs: release-please | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout PR branch | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| ref: release-please--branches--${{ github.ref_name }} | |
| - 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: Update dependency versions using melos | |
| run: | | |
| # Run melos version in dry-run to update dependency versions in pubspec.yaml | |
| # This will update dependencies between packages to match new versions | |
| echo "Updating dependency versions..." | |
| # Read the current versions and update dependencies manually | |
| node scripts/update-dependencies.js | |
| - name: Configure git | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Commit dependency updates | |
| run: | | |
| if git diff --quiet; then | |
| echo "No dependency updates needed" | |
| else | |
| git add packages/*/pubspec.yaml | |
| git commit -m "chore: update package dependencies" | |
| git push origin release-please--branches--${{ github.ref_name }} | |
| echo "Pushed dependency updates to release PR" | |
| fi | |
| 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: 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 |