Skip to content

Commit 033f7d3

Browse files
authored
chore: add release automation (#43)
1 parent e02cc9d commit 033f7d3

File tree

4 files changed

+59
-2
lines changed

4 files changed

+59
-2
lines changed

Diff for: .github/workflows/release-please.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: release-please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
release-please:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
release_created: ${{ steps.release.outputs.release_created }}
14+
steps:
15+
- uses: googleapis/release-please-action@v4
16+
id: release
17+
with:
18+
config-file: release-please-config.json
19+
manifest-file: .release-please-manifest.json
20+
21+
npm-publish:
22+
needs: release-please
23+
if: ${{ needs.release-please.outputs.release_created }}
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: lts/*
30+
registry-url: 'https://registry.npmjs.org'
31+
- run: npm publish --access public
32+
env:
33+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Diff for: .release-please-manifest.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "1.1.0"
3+
}

Diff for: CREATING_A_RELEASE.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@ want to be able to do releases ask one of the existing collaborators to add
55
you. If necessary you can ask the build Working Group who manages the Node.js
66
npm user to add you if there are no other active collaborators.
77

8-
## Prerequisites
8+
Generally, the release is handled by the
9+
[release-please](https://github.com/nodejs/node-api-headers/blob/main/.github/workflows/release-please.yml)
10+
GitHub action. It will bump the version in `package.json` and publish
11+
node-api-headers to npm.
12+
13+
In cases that the release-please action is not working, please follow the steps
14+
below to publish node-api-headers manually.
15+
16+
## Publish new release manually
17+
18+
### Prerequisites
919

1020
Before to start creating a new release check if you have installed the following
1121
tools:
@@ -15,7 +25,7 @@ tools:
1525
If not please follow the instruction reported in the tool's documentation to
1626
install it.
1727

18-
## Publish new release
28+
### Steps
1929

2030
These are the steps to follow to create a new release:
2131

Diff for: release-please-config.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"release-type": "node",
4+
"pull-request-title-pattern": "chore: release v${version}",
5+
"bootstrap-sha": "186e04b5e40e54d7fd1655bc67081cc483f12488",
6+
"packages": {
7+
".": {
8+
"changelog-path": "CHANGELOG.md"
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)