Skip to content
Open
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
11 changes: 9 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # tags, to find the previous release

- name: Install pnpm
uses: pnpm/action-setup@v6
Expand Down Expand Up @@ -50,13 +52,18 @@ jobs:
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Extracted version: $VERSION"

- name: Create draft release
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: |
# Previous stable tag, skipping beta tags such as v2.8.0-beta.<timestamp>.<sha>
PREVIOUS_TAG=$(git describe --tags --abbrev=0 --match 'v*' --exclude '*-*' "${GITHUB_REF_NAME}^")
echo "Release notes since $PREVIOUS_TAG"
gh release create "$GITHUB_REF_NAME" \
--title "Release v${VERSION}" \
--draft
--generate-notes \
--notes-start-tag "$PREVIOUS_TAG" \
--latest

publish-prerelease:
name: Pre-release (develop)
Expand Down
4 changes: 2 additions & 2 deletions nodejs/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Branches: `develop` is the integration branch, and `master` holds released code. Publishing is done by `.github/workflows/publish.yml`:

- Pushing a `v*` tag builds the package, runs `pnpm publish` to npm `latest` (OIDC trusted publishing) and creates a **draft** GitHub release.
- Pushing a `v*` tag builds the package, runs `pnpm publish` to npm `latest` (OIDC trusted publishing) and publishes a GitHub release marked latest, with notes generated from the PRs merged since the previous `vX.Y.Z` tag.
- Every push to `develop` publishes `<version>-beta.<timestamp>.<sha>` to the npm `beta` tag. Nothing needs to be done by hand for this.

Steps (shown for a minor release, `X.Y.0`):
Expand All @@ -24,6 +24,6 @@ Steps (shown for a minor release, `X.Y.0`):
```
5. Merge `master` back into `develop` and push, so the bump is on `develop`.
6. Confirm the "Publish to NPM" run for the tag passed, and that `npm view @hackmd/api dist-tags.latest` shows `X.Y.0`. The registry can take a minute or two to update.
7. Ask the maintainer to write release notes for the draft GitHub release and publish it. The workflow leaves it empty.
7. Check the GitHub release for `vX.Y.0`. Its notes are generated automatically; edit them if the release needs highlights or upgrade notes.

For a patch or major release, use the same steps with the matching version number.
Loading