Skip to content

Commit

Permalink
Workaround to publish
Browse files Browse the repository at this point in the history
  • Loading branch information
landarskiy committed Mar 3, 2024
1 parent 551213f commit 6eb22fd
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
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 }}

0 comments on commit 6eb22fd

Please sign in to comment.