Prepare drift 2.34.3 release #124
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: | |
| - 'drift-[0-9]+.[0-9]+.[0-9]+*' | |
| - 'drift_dev-[0-9]+.[0-9]+.[0-9]+*' | |
| - 'sqlparser-[0-9]+.[0-9]+.[0-9]+*' | |
| - 'drift_postgres-[0-9]+.[0-9]+.[0-9]+*' | |
| - 'drift_flutter-[0-9]+.[0-9]+.[0-9]+*' | |
| jobs: | |
| setup: | |
| uses: ./.github/workflows/setup.yml | |
| publish_drift: | |
| if: "${{ startsWith(github.ref_name, 'drift-') }}" | |
| needs: [setup] | |
| runs-on: ubuntu-latest | |
| environment: pub.dev | |
| permissions: | |
| id-token: write # Required for authentication using OIDC | |
| packages: write # Needed to upload release assets | |
| contents: write # Needed to upload release assets | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Install dart because the action installs a pub token. | |
| - uses: dart-lang/setup-dart@v1 | |
| # We need to build the DevTools extension, which is written in Flutter | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| - uses: actions/cache@v3 | |
| with: | |
| path: "${{ env.PUB_CACHE }}" | |
| key: dart-dependencies-${{ needs.setup.outputs.dart_version }}-${{ hashFiles('**/pubspec.yaml') }} | |
| restore-keys: | | |
| dart-dependencies-${{ needs.setup.outputs.dart_version }}- | |
| dart-dependencies- | |
| # Prepare assets attached to releases. Because the drift worker needs a sqlite3.wasm from | |
| # a matching package:sqlite3 version, we attach it to releases as well. | |
| - run: dart pub get | |
| - name: Download WebAssembly assets | |
| run: dart tool/download_sqlite_wasm.dart | |
| - name: Compile drift worker | |
| run: dart compile js -O4 --no-source-maps web/drift_worker.dart -o drift_worker.js | |
| working-directory: drift | |
| - name: Build DevTools extension | |
| working-directory: extras/drift_devtools_extension | |
| run: ./build.sh | |
| - run: dart pub lish --dry-run | |
| working-directory: drift | |
| - name: Set tag name | |
| id: tag | |
| run: | | |
| tag=$(basename "${GITHUB_REF}") | |
| echo "tag=$tag" >> $GITHUB_OUTPUT | |
| - name: Create Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GH_REPO: ${{ github.repository }} | |
| STEPS_TAG_OUTPUTS_TAG: ${{ steps.tag.outputs.tag }} | |
| run: | | |
| tag="${STEPS_TAG_OUTPUTS_TAG}" | |
| body="Pending release for $tag" | |
| gh release create --draft "$tag" --title "$tag" --notes "$body" | |
| gh release upload "$tag" extras/assets/*.wasm drift/drift_worker.js | |
| - run: dart pub lish -f | |
| working-directory: drift | |
| publish_drift_dev: | |
| if: "${{ startsWith(github.ref_name, 'drift_dev-') }}" | |
| needs: [setup] | |
| runs-on: ubuntu-latest | |
| environment: pub.dev | |
| permissions: | |
| id-token: write # Required for authentication using OIDC | |
| defaults: | |
| run: | |
| working-directory: drift_dev | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Install dart because the action installs a pub token. | |
| - uses: dart-lang/setup-dart@v1 | |
| - uses: ./.github/actions/prepare | |
| with: | |
| dart_version: ${{ needs.setup.outputs.dart_version }} | |
| - run: dart pub lish --dry-run | |
| - run: dart pub lish -f | |
| # Published versions of sqlparser are tagged with `sqlparser-<version>` | |
| publish_sqlparser: | |
| if: "${{ startsWith(github.ref_name, 'sqlparser-') }}" | |
| needs: [setup] | |
| runs-on: ubuntu-latest | |
| environment: pub.dev | |
| permissions: | |
| id-token: write # Required for authentication using OIDC | |
| defaults: | |
| run: | |
| working-directory: sqlparser | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Install dart because the action installs a pub token. | |
| - uses: dart-lang/setup-dart@v1 | |
| - uses: ./.github/actions/prepare | |
| with: | |
| dart_version: ${{ needs.setup.outputs.dart_version }} | |
| - run: dart pub get | |
| - run: dart pub lish --dry-run | |
| - run: dart pub lish -f | |
| publish_drift_postgres: | |
| if: "${{ startsWith(github.ref_name, 'drift_postgres-') }}" | |
| needs: [setup] | |
| runs-on: ubuntu-latest | |
| environment: pub.dev | |
| permissions: | |
| id-token: write # Required for authentication using OIDC | |
| defaults: | |
| run: | |
| working-directory: extras/drift_postgres | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Install dart because the action installs a pub token. | |
| - uses: dart-lang/setup-dart@v1 | |
| - uses: ./.github/actions/prepare | |
| with: | |
| dart_version: ${{ needs.setup.outputs.dart_version }} | |
| - run: dart pub get | |
| - run: dart pub lish --dry-run | |
| - run: dart pub lish -f | |
| publish_drift_flutter: | |
| if: "${{ startsWith(github.ref_name, 'drift_flutter-') }}" | |
| needs: [setup] | |
| runs-on: ubuntu-latest | |
| environment: pub.dev | |
| permissions: | |
| id-token: write # Required for authentication using OIDC | |
| defaults: | |
| run: | |
| working-directory: drift_flutter | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Install dart because the action installs a pub token. | |
| - uses: dart-lang/setup-dart@v1 | |
| - uses: ./.github/actions/prepare | |
| with: | |
| dart_version: ${{ needs.setup.outputs.dart_version }} | |
| - run: dart pub get | |
| - run: flutter pub publish --dry-run | |
| - run: flutter pub publish -f |