Skip to content

Commit 56c2a23

Browse files
committed
chore: add GitHub workflows for npm publishing and release automation
1 parent 6e6e735 commit 56c2a23

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

.github/workflows/npm-publish.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Publish to npm
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
working-directory: packages/nuxt-jsonld
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: '20'
19+
registry-url: 'https://registry.npmjs.org/'
20+
- run: npm ci
21+
- run: npm publish
22+
env:
23+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release-please.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This workflow uses release-please to automate the release process for packages/nuxt-jsonld.
2+
#
3+
# 1. When a commit is pushed to master, it creates a Release PR based on Conventional Commits.
4+
# 2. When the Release PR is merged, release-please automatically:
5+
# - Updates CHANGELOG.md and package.json
6+
# - Creates and pushes a new git tag (e.g. v1.4.1)
7+
# 3. The npm-publish workflow is triggered by the tag creation, publishing the package to npm.
8+
9+
name: Create Release PR
10+
11+
on:
12+
push:
13+
branches:
14+
- master
15+
16+
jobs:
17+
release:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: google-github-actions/release-please-action@v4
22+
with:
23+
token: ${{ secrets.GITHUB_TOKEN }}

.release-please-config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"packages": {
3+
"packages/nuxt-jsonld": {
4+
"release-type": "node",
5+
"package-name": "nuxt-jsonld"
6+
}
7+
}
8+
}

0 commit comments

Comments
 (0)