Skip to content

Commit d24f4c3

Browse files
committed
Combine release and publish into single workflow
pub.dev OIDC only allows publishing from workflow_dispatch or push events, not from workflow_run events. Combined workflows to use workflow_dispatch.
1 parent ebc8bab commit d24f4c3

2 files changed

Lines changed: 11 additions & 69 deletions

File tree

.github/workflows/publish-on-release.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Create Release
1+
name: Release and Publish
22

33
on:
44
workflow_dispatch:
@@ -12,10 +12,11 @@ on:
1212
- mcp_dart_cli
1313

1414
jobs:
15-
create-release:
15+
release-and-publish:
1616
runs-on: ubuntu-latest
1717
permissions:
1818
contents: write # Required to create tags and releases
19+
id-token: write # Required for pub.dev OIDC authentication
1920
steps:
2021
- uses: actions/checkout@v4
2122

@@ -69,12 +70,12 @@ jobs:
6970
generate_release_notes: true
7071
draft: false
7172

72-
- name: Save tag for publish workflow
73-
run: echo "${{ steps.create-tag.outputs.tag }}" > tag.txt
73+
- uses: dart-lang/setup-dart@v1
7474

75-
- name: Upload tag artifact
76-
uses: actions/upload-artifact@v4
77-
with:
78-
name: release-tag
79-
path: tag.txt
80-
retention-days: 1
75+
- name: Install dependencies
76+
working-directory: ${{ steps.set-config.outputs.working_directory }}
77+
run: dart pub get
78+
79+
- name: Publish to pub.dev
80+
working-directory: ${{ steps.set-config.outputs.working_directory }}
81+
run: dart pub publish --force

0 commit comments

Comments
 (0)