Skip to content

Commit 556b82e

Browse files
committed
fix: make release workflow tag driven
1 parent 76e1f5e commit 556b82e

2 files changed

Lines changed: 11 additions & 40 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Release
22

33
on:
44
push:
5-
branches:
6-
- main
5+
tags:
6+
- "v*.*.*"
77
workflow_dispatch:
88
inputs:
99
tag:
@@ -14,37 +14,13 @@ on:
1414
permissions:
1515
contents: write
1616
id-token: write
17-
pull-requests: write
1817

1918
jobs:
20-
release-please:
21-
name: Create release PR or GitHub Release
22-
if: github.event_name == 'push'
23-
runs-on: ubuntu-latest
24-
outputs:
25-
release_created: ${{ steps.release.outputs.release_created }}
26-
tag_name: ${{ steps.release.outputs.tag_name }}
27-
steps:
28-
- name: Run Release Please
29-
id: release
30-
uses: googleapis/release-please-action@8b8fd2cc23b2e18957157a9d923d75aa0c6f6ad5 # v4
31-
with:
32-
config-file: release-please-config.json
33-
manifest-file: .release-please-manifest.json
34-
3519
publish-release:
3620
name: Publish package
37-
needs:
38-
- release-please
39-
if: >-
40-
always()
41-
&& (
42-
(github.event_name == 'push' && needs.release-please.outputs.release_created == 'true')
43-
|| github.event_name == 'workflow_dispatch'
44-
)
4521
runs-on: ubuntu-latest
4622
env:
47-
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || needs.release-please.outputs.tag_name }}
23+
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
4824
steps:
4925
- name: Checkout release tag
5026
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5

docs/releasing.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ MiniWeb publishes to npm as `@async/miniweb`.
44

55
## Normal Release Flow
66

7-
MiniWeb uses Release Please. Merge Conventional Commit changes into `main`; the release workflow opens or updates a release PR that bumps `package.json`, updates `package-lock.json`, and updates `CHANGELOG.md`.
7+
MiniWeb includes Release Please config for changelog and version PRs. Merge Conventional Commit changes into `main`; then create a release PR with Release Please once GitHub Actions PR creation is enabled for the `async-framework` organization or a dedicated release token is configured.
88

9-
When the release PR merges, the workflow creates the GitHub Release, verifies the package, publishes to npm, and attaches the exact packed tarball to the GitHub Release.
9+
When the release PR merges, push the release tag. The `Release` workflow verifies the package, publishes to npm through Trusted Publishing, creates the GitHub Release if needed, and attaches the exact packed tarball to the GitHub Release.
1010

1111
## npm Trusted Publishing
1212

@@ -19,23 +19,18 @@ Configure npm Trusted Publishing for this package before the first automated pub
1919

2020
The workflow uses GitHub OIDC with `id-token: write`; it does not use an `NPM_TOKEN` secret.
2121

22+
The repository workflow is tag-triggered because the `async-framework` organization currently blocks `GITHUB_TOKEN` from creating pull requests. To let Release Please open changelog PRs from Actions, an organization admin must allow GitHub Actions to create pull requests, or the workflow must be updated to use a dedicated release token.
23+
2224
## First Release
2325

24-
The first package version is `0.1.0`. After the release automation is pushed and npm Trusted Publishing is configured, create and push the initial tag:
26+
The first package version is `0.1.0`. It was published manually from a verified tarball because npm Trusted Publishing can only be configured after the package exists. Future releases should use the tag-triggered workflow after Trusted Publishing is configured.
2527

2628
```sh
27-
git tag v0.1.0
28-
git push origin main v0.1.0
29-
```
30-
31-
Then run the `Release` workflow manually with:
32-
33-
```txt
34-
tag: v0.1.0
29+
npm run release:check
30+
git tag vX.Y.Z
31+
git push origin main vX.Y.Z
3532
```
3633

37-
The manual workflow path exists so the first release can publish the already prepared initial version. Future releases should use Release Please PRs.
38-
3934
## Local Verification
4035

4136
Run this before tagging or merging a release PR:

0 commit comments

Comments
 (0)