Skip to content

Commit 132c9b0

Browse files
authored
chore(workflows): consolidate deployment workflows and implement OIDC for npm publishing (#141)
1 parent 98d3ed6 commit 132c9b0

File tree

4 files changed

+69
-96
lines changed

4 files changed

+69
-96
lines changed

.github/workflows/deploy-beta.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.github/workflows/deploy-release.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
name: 'Build & Deploy'
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
release:
9+
types:
10+
- published
11+
12+
permissions:
13+
contents: read
14+
id-token: write
15+
16+
concurrency:
17+
group: ${{ github.ref_name }}-${{ github.workflow }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
deploy_beta:
22+
name: Deploy to NPM (beta)
23+
if: github.event_name == 'push'
24+
runs-on: ubuntu-latest
25+
environment:
26+
name: release
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: '24.x'
32+
registry-url: 'https://registry.npmjs.org'
33+
scope: nvuillam
34+
- run: npm ci
35+
- run: |
36+
git config --global user.name nvuillam
37+
git config --global user.email [email protected]
38+
- name: Bump beta prerelease version
39+
run: |
40+
BETAID=$(date '+%Y%m%d%H%M')
41+
npm version prerelease --preid="beta${BETAID}"
42+
shell: bash
43+
- name: Publish beta package
44+
run: npm publish --tag beta --provenance
45+
46+
deploy_release:
47+
name: Deploy to NPM (release)
48+
if: github.event_name == 'release' && github.event.action == 'created'
49+
runs-on: ubuntu-latest
50+
environment:
51+
name: release
52+
steps:
53+
- uses: actions/checkout@v4
54+
- uses: actions/setup-node@v4
55+
with:
56+
node-version: '24.x'
57+
registry-url: 'https://registry.npmjs.org'
58+
scope: nvuillam
59+
- run: npm ci
60+
- run: |
61+
git config --global user.name nvuillam
62+
git config --global user.email [email protected]
63+
- name: Publish release package
64+
run: npm publish --provenance

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## Unreleased
44

5+
## [4.3.2] 2025-01-24
6+
7+
- Upgrade dependencies
8+
- Refactor workflows to use OIDC (npm Trusted Publishers) to publish package
9+
510
## [4.3.1] 2025-12-04
611

712
- Upgrade njre dependency

0 commit comments

Comments
 (0)