Skip to content

Commit 41a86d0

Browse files
authored
ci: publish from release events (#628)
1 parent fa4b6a9 commit 41a86d0

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@ on:
44
push:
55
branches:
66
- main
7-
workflow_dispatch:
8-
inputs:
9-
tag_name:
10-
description: Existing tag to publish, for example v0.2.0
11-
required: true
12-
type: string
7+
release:
8+
types:
9+
- published
1310

1411
concurrency:
1512
group: auto-release-${{ github.ref }}
@@ -18,6 +15,7 @@ concurrency:
1815
jobs:
1916
release-please:
2017
name: Release Please
18+
if: ${{ github.event_name == 'push' }}
2119
runs-on: ubuntu-latest
2220
permissions:
2321
contents: write
@@ -36,8 +34,7 @@ jobs:
3634

3735
publish-npm:
3836
name: Publish to npm
39-
needs: release-please
40-
if: ${{ github.event_name == 'workflow_dispatch' || needs.release-please.outputs.release_created == 'true' }}
37+
if: ${{ github.event_name == 'release' }}
4138
runs-on: ubuntu-latest
4239
environment: release
4340
permissions:
@@ -47,7 +44,7 @@ jobs:
4744
- name: Checkout release tag
4845
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
4946
with:
50-
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag_name || needs.release-please.outputs.tag_name }}
47+
ref: ${{ github.event.release.tag_name }}
5148
fetch-depth: 0
5249

5350
- name: Set up Node.js
@@ -87,8 +84,8 @@ jobs:
8784
- name: Release summary
8885
run: |
8986
{
90-
echo "## Released ${{ needs.release-please.outputs.tag_name }}"
87+
echo "## Released ${{ github.event.release.tag_name }}"
9188
echo
9289
echo "- npm: https://www.npmjs.com/package/@gitlawb/openclaude"
93-
echo "- GitHub: https://github.com/Gitlawb/openclaude/releases/tag/${{ needs.release-please.outputs.tag_name }}"
90+
echo "- GitHub: https://github.com/Gitlawb/openclaude/releases/tag/${{ github.event.release.tag_name }}"
9491
} >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)