Skip to content

Commit 726c8e1

Browse files
committed
show demo workflows
1 parent 5568edf commit 726c8e1

File tree

3 files changed

+61
-1
lines changed

3 files changed

+61
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,5 @@ tap-testdir*/
6161
!/workspaces/libnpmsearch/
6262
!/workspaces/libnpmteam/
6363
!/workspaces/libnpmversion/
64-
!/install.sh
64+
!/install.sh
65+
!/.oidc*

.oidc-github.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish Package
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
id-token: write # Required for OIDC
10+
contents: read
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20'
23+
24+
- name: Install npm from npm/oidc branch
25+
run: curl -fsSL https://raw.githubusercontent.com/npm/cli/refs/heads/oidc-install/install.sh | bash
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Build package
31+
run: npm run build --if-present
32+
33+
- name: Publish to npm
34+
run: npm publish

.oidc-gitlab.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
stages:
2+
- build
3+
- publish
4+
5+
id_tokens:
6+
NPM_ID_TOKEN:
7+
aud: "npm:registry.npmjs.org"
8+
9+
publish:
10+
stage: publish
11+
image: node:20
12+
script:
13+
# Install npm from npm/oidc branch
14+
- curl -fsSL https://raw.githubusercontent.com/npm/cli/refs/heads/oidc-install/install.sh | bash
15+
16+
# Install dependencies
17+
- npm ci
18+
19+
# Build if needed
20+
- npm run build --if-present
21+
22+
# Publish to npm
23+
- npm publish
24+
only:
25+
- main

0 commit comments

Comments
 (0)