Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround to publish #6

Merged
merged 1 commit into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
publish:
permissions:
id-token: write
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
uses: touchlane/gridpad_flutter/.github/workflows/publishing_to_pub.yml@v1
44 changes: 44 additions & 0 deletions .github/workflows/publishing_to_pub.yml
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 }}
Loading