Skip to content

Commit

Permalink
add an sdk workflow input param (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
devoncarew authored Feb 17, 2023
1 parent 89caa28 commit bd558ac
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,29 @@ name: Publish
# publish:
# uses: dart-lang/ecosystem/.github/workflows/publish.yml@main

# Callers may optionally specify the version of the SDK to use when publishing a
# package. This can be useful if your package has a very recent minimum SDK
# constraint. This is done via the `sdk` input parameter. Note that this
# parameter is not required; it defaults to `stable` - using the most recent
# stable release of the Dart SDK. To pass this value:
#
# jobs:
# publish:
# uses: dart-lang/ecosystem/.github/workflows/publish.yml@main
# with:
# sdk: beta

on:
workflow_call:
inputs:
sdk:
description: >-
The channel, or a specific version from a channel, to install
('2.19.0','stable', 'beta', 'dev'). Using one of the three channels
will give you the latest version published to that channel.
default: "stable"
required: false
type: string

jobs:
publish:
Expand All @@ -29,6 +50,8 @@ jobs:
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
- uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46
with:
sdk: ${{ inputs.sdk }}

- name: Install firehose
run: dart pub global activate firehose
Expand Down
4 changes: 4 additions & 0 deletions pkgs/firehose/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.13

- Added the ability to specify the version of the SDK to use for publishing.

## 0.3.12

- Don't have issues creating PR comments fail the job.
Expand Down
16 changes: 16 additions & 0 deletions pkgs/firehose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,22 @@ jobs:
uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main
```
## Publishing from a specific version of the SDK
Callers may optionally specify the version of the SDK to use when publishing a
package. This can be useful if your package has a very recent minimum SDK
constraint. This is done via the `sdk` input parameter. Note that this parameter
is not required; it defaults to `stable` - using the most recent stable release
of the Dart SDK. To pass this value:

```yaml
jobs:
publish:
uses: dart-lang/ecosystem/.github/workflows/publish.yml@main
with:
sdk: beta
```

## Workflow docs

The description of the common workflow for repos using this tool can be found at
Expand Down
2 changes: 1 addition & 1 deletion pkgs/firehose/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: firehose
description: A tool to automate publishing of Pub packages from GitHub actions.
version: 0.3.12
version: 0.3.13
repository: https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose

environment:
Expand Down

0 comments on commit bd558ac

Please sign in to comment.