Skip to content

Commit

Permalink
chore: add release automation (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinEady authored Jul 9, 2024
1 parent e02cc9d commit 033f7d3
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 2 deletions.
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"
}
}
}

0 comments on commit 033f7d3

Please sign in to comment.