Skip to content

Commit a1d8526

Browse files
authored
Add sdk input to publish.yml reusable workflow (#206)
1 parent a5bff65 commit a1d8526

3 files changed

Lines changed: 26 additions & 0 deletions

File tree

‎.github/workflows/dart.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,14 @@ jobs:
152152
working-directory: example
153153
use-flutter: false
154154
test-run: true
155+
156+
test_publish_dart_dev:
157+
needs: [test_publish_dart]
158+
permissions:
159+
id-token: write
160+
uses: ./.github/workflows/publish.yml
161+
with:
162+
working-directory: example
163+
sdk: dev
164+
use-flutter: false
165+
test-run: true

‎.github/workflows/publish.yml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ name: Publish to pub.dev
99
## uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
1010
## # with:
1111
## # working-directory: path/to/sub/directory
12+
## # sdk: stable
1213
## # use-flutter: false
1314

1415
on:
@@ -23,6 +24,13 @@ on:
2324
required: false
2425
default: '.'
2526
type: string
27+
sdk:
28+
description: >-
29+
The Dart SDK channel ('stable', 'beta', 'dev'), release version
30+
('3.13'), or specific version ('3.14.0-286.0.dev') to install.
31+
required: false
32+
default: 'stable'
33+
type: string
2634
use-flutter:
2735
description: Whether to install the Flutter SDK in addition to the Dart SDK.
2836
required: false
@@ -45,6 +53,8 @@ jobs:
4553

4654
- name: Set up Dart
4755
uses: dart-lang/setup-dart@6afc89df92d6eb3834022f73cd65adc8cdfcb92d # v1
56+
with:
57+
sdk: ${{ inputs.sdk }}
4858

4959
- name: Set up Flutter
5060
if: ${{ inputs.use-flutter }}
@@ -69,6 +79,8 @@ jobs:
6979

7080
- name: Set up Dart
7181
uses: dart-lang/setup-dart@6afc89df92d6eb3834022f73cd65adc8cdfcb92d # v1
82+
with:
83+
sdk: ${{ inputs.sdk }}
7284

7385
- name: Package archive for provenance
7486
env:
@@ -96,6 +108,8 @@ jobs:
96108
steps:
97109
- name: Set up Dart
98110
uses: dart-lang/setup-dart@6afc89df92d6eb3834022f73cd65adc8cdfcb92d # v1
111+
with:
112+
sdk: ${{ inputs.sdk }}
99113

100114
- name: Download package archive
101115
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## v1.8.2-wip
22

33
* Update `publish.yml` to a three-job workflow (`validate`, `package`, `publish`) supporting hermetic package archiving (`--to-archive` / `--from-archive`).
4+
* Add `sdk` input to `publish.yml` to support publishing packages that require a non-stable Dart SDK (e.g., `beta` or `dev`).
45

56
## v1.8.1
67

0 commit comments

Comments
 (0)