-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed1263f
commit 573f1f3
Showing
2 changed files
with
45 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Publish to pub.dev | ||
|
||
## Temporary workaround for the issue: https://github.com/dart-lang/setup-dart/issues/68 | ||
## Originally copied from: https://github.com/dart-lang/setup-dart/blob/main/.github/workflows/publish.yml | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
environment: | ||
description: if specified, the workflow is required to be run in this environment (with additional approvals) | ||
required: false | ||
type: string | ||
working-directory: | ||
description: directory with-in the repository where the package is located (if not in the repository root) | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
publish: | ||
name: 'Publish to pub.dev' | ||
environment: ${{ inputs.environment }} | ||
permissions: | ||
id-token: write # This is required for requesting the JWT | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout repository | ||
- uses: actions/checkout@v4 | ||
# Setup Flutter SDK | ||
- name: Setup Flutter SDK | ||
uses: flutter-actions/setup-flutter@v2 | ||
with: | ||
channel: stable | ||
version: 3.19.2 | ||
# Minimal package setup and dry run checks. | ||
- name: Install dependencies | ||
run: flutter pub get | ||
working-directory: ${{ inputs.working-directory }} | ||
- name: Publish - dry run | ||
run: dart pub publish --dry-run | ||
working-directory: ${{ inputs.working-directory }} | ||
# Publishing... | ||
- name: Publish to pub.dev | ||
run: dart pub publish -f | ||
working-directory: ${{ inputs.working-directory }} |