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: Publish to pub.dev | |
| on: | |
| push: | |
| tags: | |
| - 'v[0-9]+.[0-9]+.[0-9]+*' | |
| concurrency: | |
| group: publish-${{ github.ref_name }} | |
| cancel-in-progress: false | |
| jobs: | |
| publish: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dart-lang/setup-dart@v1 | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| - name: Install Melos | |
| run: dart pub global activate melos | |
| - name: Resolve Root Dependencies | |
| run: flutter pub get | |
| - name: Bootstrap Workspace | |
| run: melos bootstrap | |
| - name: Analyze | |
| run: melos exec -- flutter analyze . | |
| - name: Test | |
| run: melos exec --dir-exists="test" -- flutter test | |
| - name: Verify release tag matches package versions | |
| env: | |
| RELEASE_TAG: ${{ github.ref_name }} | |
| run: | | |
| TAG_VERSION="${RELEASE_TAG#v}" | |
| for package in \ | |
| packages/survey_kit \ | |
| packages/survey_kit_audio \ | |
| packages/survey_kit_lottie \ | |
| packages/survey_kit_video | |
| do | |
| PACKAGE_VERSION="$(sed -n 's/^version: //p' "$package/pubspec.yaml")" | |
| if [ "$PACKAGE_VERSION" != "$TAG_VERSION" ]; then | |
| echo "Tag version ($TAG_VERSION) does not match $package version ($PACKAGE_VERSION)." | |
| exit 1 | |
| fi | |
| done | |
| - name: Publish packages | |
| run: | | |
| for package in packages/survey_kit packages/survey_kit_audio packages/survey_kit_lottie packages/survey_kit_video; do | |
| echo "Publishing $package..." | |
| dart pub -C "$package" publish --force | |
| done |