Skip to content

chore: add release automation #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2024
Merged
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
33 changes: 33 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: release-please

on:
push:
branches:
- main
workflow_dispatch:

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

npm-publish:
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
registry-url: 'https://registry.npmjs.org'
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.1.0"
}
14 changes: 12 additions & 2 deletions CREATING_A_RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ want to be able to do releases ask one of the existing collaborators to add
you. If necessary you can ask the build Working Group who manages the Node.js
npm user to add you if there are no other active collaborators.

## Prerequisites
Generally, the release is handled by the
[release-please](https://github.com/nodejs/node-api-headers/blob/main/.github/workflows/release-please.yml)
GitHub action. It will bump the version in `package.json` and publish
node-api-headers to npm.

In cases that the release-please action is not working, please follow the steps
below to publish node-api-headers manually.

## Publish new release manually

### Prerequisites

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

## Publish new release
### Steps

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

Expand Down
11 changes: 11 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"release-type": "node",
"pull-request-title-pattern": "chore: release v${version}",
"bootstrap-sha": "186e04b5e40e54d7fd1655bc67081cc483f12488",
"packages": {
".": {
"changelog-path": "CHANGELOG.md"
}
}
}