Skip to content

Commit 94ece73

Browse files
authored
Backport release workflow (#45)
1 parent f805c3e commit 94ece73

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
permissions:
9+
id-token: write # Required for NPM trusted publishing.
10+
contents: read
11+
12+
jobs:
13+
npm:
14+
name: Publish to npm
15+
runs-on: ubuntu-latest
16+
environment:
17+
name: release
18+
permissions:
19+
contents: read
20+
id-token: write
21+
steps:
22+
- uses: actions/checkout@v7
23+
- uses: actions/setup-node@v7
24+
with:
25+
node-version: latest
26+
package-manager-cache: false # Disable automatic npm dependency caching to reduce cache poisoning risk
27+
- run: npm install --ignore-scripts --package-lock=false
28+
- run: npm test
29+
- run: npm stage publish # Runs prepublish script.

‎package.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"url"
1313
],
1414
"repository": "pillarjs/encodeurl",
15+
"publishConfig": {
16+
"tag": "latest-2.x"
17+
},
1518
"funding": {
1619
"type": "opencollective",
1720
"url": "https://opencollective.com/express"

0 commit comments

Comments
 (0)