chore: Fix publish pipeline (#137)
This commit is contained in:
parent
962b247099
commit
16d15eebe5
4 changed files with 43 additions and 5 deletions
35
.github/workflows/publish-package.yml
vendored
Normal file
35
.github/workflows/publish-package.yml
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
name: Publish package to pub.dev
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
working-directory:
|
||||
description: Directory of the package to publish.
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
# setup-dart also configures OIDC authentication for pub.dev.
|
||||
- uses: dart-lang/setup-dart@v1
|
||||
with:
|
||||
sdk: 3.12.2
|
||||
|
||||
- name: Install dependencies
|
||||
run: dart pub get
|
||||
|
||||
- name: Publish - dry run
|
||||
# Exact dependency versions produce warnings. Keep validation errors fatal.
|
||||
run: dart pub publish --dry-run --ignore-warnings
|
||||
|
||||
- name: Publish to pub.dev
|
||||
run: dart pub publish --force
|
||||
9
.github/workflows/publish.yml
vendored
9
.github/workflows/publish.yml
vendored
|
|
@ -10,23 +10,26 @@ on:
|
|||
jobs:
|
||||
publish-serverpod_offline_sync:
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
|
||||
uses: ./.github/workflows/publish-package.yml
|
||||
with:
|
||||
working-directory: packages/serverpod_offline_sync
|
||||
|
||||
publish-serverpod_offline_sync_client:
|
||||
needs: publish-serverpod_offline_sync
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
|
||||
uses: ./.github/workflows/publish-package.yml
|
||||
with:
|
||||
working-directory: packages/serverpod_offline_sync_client
|
||||
|
||||
publish-serverpod_offline_sync_server:
|
||||
needs: publish-serverpod_offline_sync
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
|
||||
uses: ./.github/workflows/publish-package.yml
|
||||
with:
|
||||
working-directory: packages/serverpod_offline_sync_server
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
[](https://github.com/marcelomendoncasoares)
|
||||
[](https://pub.dev/packages/serverpod_offline_sync)
|
||||
[](https://pub.dev/packages/serverpod_offline_sync)
|
||||
[](https://pub.dev/packages/serverpod_offline_sync)
|
||||
[](https://github.com/marcelomendoncasoares/serverpod_offline_sync/blob/main/LICENSE)
|
||||
[](https://github.com/marcelomendoncasoares/serverpod_offline_sync/actions/workflows/ci.yaml)
|
||||
|
||||
|
|
|
|||
|
|
@ -128,4 +128,4 @@ melos:
|
|||
reset:
|
||||
exec: rm -f test.db*
|
||||
publish-check:
|
||||
run: melos exec --category="publish" -- dart pub publish --dry-run
|
||||
run: melos exec --category="publish" -- dart pub publish --dry-run --ignore-warnings
|
||||
|
|
|
|||
Loading…
Reference in a new issue