Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 16 additions & 19 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,27 @@
name: Publish to pub.dev

on:
release:
types:
- published

permissions:
contents: read
push:
tags:
- '*.*.*'

jobs:
publish:
name: Publish Dart package
validate:
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Dart
- name: Set up Dart SDK
uses: dart-lang/setup-dart@v1
with:
sdk: stable

- name: Install dependencies
run: dart pub get

- name: Set up pub.dev credentials
env:
PUB_CREDENTIALS_JSON: ${{ secrets.PUB_CREDENTIALS_JSON }}
run: |
mkdir -p "$HOME/.config/dart"
printf '%s' "$PUB_CREDENTIALS_JSON" | jq -e '.' > "$HOME/.config/dart/pub-credentials.json"

- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .

Expand All @@ -41,8 +31,15 @@ jobs:
- name: Run tests
run: dart test

- name: Validate package publication
- name: Compile integration client
run: dart compile exe tool/integration_test.dart -o /tmp/core_web3dart_integration_test

- name: Validate publishable package
run: dart pub publish --dry-run

- name: Publish package
run: dart pub publish --force
publish-pub-dev:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs: validate
permissions:
id-token: write
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
Loading