Merge pull request #24 from ahmadexe/fix/pana-restriction-removed #3
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: | |
| - 'agenix-v[0-9]+.[0-9]+.[0-9]+' | |
| - 'agenix_firebase-v[0-9]+.[0-9]+.[0-9]+' | |
| jobs: | |
| guard: | |
| uses: ./.github/workflows/ci.yml | |
| publish: | |
| needs: guard | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| flutter-version: 3.44.3 | |
| cache: true | |
| - name: Resolve package + version from tag | |
| id: pkg | |
| run: | | |
| TAG="${GITHUB_REF_NAME}" | |
| NAME="${TAG%-v*}" | |
| VER="${TAG##*-v}" | |
| echo "name=$NAME" >> "$GITHUB_OUTPUT" | |
| echo "version=$VER" >> "$GITHUB_OUTPUT" | |
| echo "dir=packages/$NAME" >> "$GITHUB_OUTPUT" | |
| - name: Install deps | |
| run: dart pub get | |
| - name: Verify tag matches pubspec version | |
| working-directory: ${{ steps.pkg.outputs.dir }} | |
| run: | | |
| PUB=$(grep '^version:' pubspec.yaml | awk '{print $2}') | |
| echo "tag=${{ steps.pkg.outputs.version }} pubspec=$PUB" | |
| test "${{ steps.pkg.outputs.version }}" = "$PUB" \ | |
| || { echo "::error::tag != pubspec version"; exit 1; } | |
| - name: Publish dry-run | |
| working-directory: ${{ steps.pkg.outputs.dir }} | |
| run: dart pub publish --dry-run | |
| - name: Publish | |
| working-directory: ${{ steps.pkg.outputs.dir }} | |
| run: dart pub publish --force |