-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix version parsing when build number is not defined
- Loading branch information
Showing
4 changed files
with
44 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,46 @@ | ||
# https://github.com/dart-lang/ecosystem/blob/main/.github/workflows/publish.yaml | ||
# https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose | ||
# A CI configuration to auto-publish pub packages. | ||
|
||
name: Publish | ||
# Continuous Deployment: Publish Package to pub.dev | ||
name: CD Publish | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
types: [opened, synchronize, reopened, labeled, unlabeled] | ||
push: | ||
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ] | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+*" | ||
|
||
# Modify the default permissions granted to GITHUB_TOKEN | ||
permissions: | ||
contents: write | ||
id-token: write | ||
pull-requests: write | ||
|
||
jobs: | ||
Publish: | ||
permissions: | ||
id-token: write | ||
pull-requests: write | ||
|
||
name: 'Publish package' | ||
name: publish | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dart-lang/setup-dart@v1 | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: subosito/flutter-action@v2 | ||
with: | ||
channel: 'stable' | ||
flutter-version: 3.24.3 | ||
|
||
- name: Get Id Token | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
let pub_token = await core.getIDToken('https://pub.dev') | ||
core.exportVariable('PUB_TOKEN', pub_token) | ||
- name: Authenticate | ||
run: flutter pub pub token add https://pub.dev --env-var PUB_TOKEN | ||
|
||
- name: Install dependencies | ||
run: flutter pub get | ||
|
||
- name: Dry Run | ||
run: flutter pub publish --dry-run | ||
|
||
- name: Install firehose | ||
run: dart pub global activate firehose | ||
|
||
- name: Validate packages | ||
if: ${{ github.event_name == 'pull_request' }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
ISSUE_NUMBER: ${{ github.event.number }} | ||
PR_LABELS: "${{ join(github.event.pull_request.labels.*.name) }}" | ||
run: dart pub global run firehose --validate | ||
|
||
- name: Publish packages | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
run: dart pub global run firehose --publish | ||
- name: Publish | ||
run: flutter pub publish --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters