chore: Fix publish pipeline (#137)

This commit is contained in:
Marcelo Mendonça Soares 2026-09-16 17:14:17 -03:00 • committed by GitHub
commit 16d15eebe5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 43 additions and 5 deletions

35
.github/workflows/publish-package.yml vendored Normal file
View 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

View file

@ -10,23 +10,26 @@ on:
jobs: jobs:
publish-serverpod_offline_sync: publish-serverpod_offline_sync:
permissions: permissions:
contents: read
id-token: write id-token: write
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 uses: ./.github/workflows/publish-package.yml
with: with:
working-directory: packages/serverpod_offline_sync working-directory: packages/serverpod_offline_sync
publish-serverpod_offline_sync_client: publish-serverpod_offline_sync_client:
needs: publish-serverpod_offline_sync needs: publish-serverpod_offline_sync
permissions: permissions:
contents: read
id-token: write id-token: write
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 uses: ./.github/workflows/publish-package.yml
with: with:
working-directory: packages/serverpod_offline_sync_client working-directory: packages/serverpod_offline_sync_client
publish-serverpod_offline_sync_server: publish-serverpod_offline_sync_server:
needs: publish-serverpod_offline_sync needs: publish-serverpod_offline_sync
permissions: permissions:
contents: read
id-token: write id-token: write
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 uses: ./.github/workflows/publish-package.yml
with: with:
working-directory: packages/serverpod_offline_sync_server working-directory: packages/serverpod_offline_sync_server

View file

@ -2,7 +2,7 @@
[![GitHub](https://img.shields.io/badge/GitHub-marcelomendoncasoares-181717.svg?style=flat&logo=github)](https://github.com/marcelomendoncasoares) [![GitHub](https://img.shields.io/badge/GitHub-marcelomendoncasoares-181717.svg?style=flat&logo=github)](https://github.com/marcelomendoncasoares)
[![Pub Package](https://img.shields.io/pub/v/serverpod_offline_sync.svg)](https://pub.dev/packages/serverpod_offline_sync) [![Pub Package](https://img.shields.io/pub/v/serverpod_offline_sync.svg)](https://pub.dev/packages/serverpod_offline_sync)
[![Dart SDK Version](https://badgen.net/pub/sdk-version/serverpod_offline_sync.svg)](https://pub.dev/packages/serverpod_offline_sync) [![Dart SDK Version](https://badgen.net/pub/sdk-version/serverpod_offline_sync)](https://pub.dev/packages/serverpod_offline_sync)
[![License: BSD 3-Clause](https://img.shields.io/badge/license-BSD_3--Clause-yellow.svg)](https://github.com/marcelomendoncasoares/serverpod_offline_sync/blob/main/LICENSE) [![License: BSD 3-Clause](https://img.shields.io/badge/license-BSD_3--Clause-yellow.svg)](https://github.com/marcelomendoncasoares/serverpod_offline_sync/blob/main/LICENSE)
[![CI](https://github.com/marcelomendoncasoares/serverpod_offline_sync/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/marcelomendoncasoares/serverpod_offline_sync/actions/workflows/ci.yaml) [![CI](https://github.com/marcelomendoncasoares/serverpod_offline_sync/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/marcelomendoncasoares/serverpod_offline_sync/actions/workflows/ci.yaml)

View file

@ -128,4 +128,4 @@ melos:
reset: reset:
exec: rm -f test.db* exec: rm -f test.db*
publish-check: publish-check:
run: melos exec --category="publish" -- dart pub publish --dry-run run: melos exec --category="publish" -- dart pub publish --dry-run --ignore-warnings