Skip to content

Commit 34bb245

Browse files
Versioned dispatch + working OIDC publishing (#90)
* Re-added provenance, and NODE_AUTH_TOKEN Also added manual dispatch * Removal of NODE_AUTH_TOKEN Doesn't work, pulling it back out, setup should do this automatically * Added ability to set version on manual workflow dispatch * Adding NPM_TOKEN for first push * Remove v from version if manual dispatching, also remvoe NPM_TOKEN now its published * Removed npm env * Moving to older setup-node ver with better OIDC supp * Debugging for OIDC * Added NPM token test again, removed debug * Attempting proper OIDC flow * Debugging for curls * Attempting different OIDC flow using github-script * Swithcing oidc endpoint * Pulled back to dead simple publish * Reinstated trigger * Removed registry-url as that will be overriding OIDC flow properly * Re-added registry * Trying to force clean env * Cleaned uip pipeline * More robust config registry * Migrate to production env * Cleanup * REadding scope * Trying to force registry config and unset all token vars * Added npm update to enforce latest * Added repo info to package --------- Co-authored-by: Carl Patchett <carl.patchett@kroll.com>
1 parent 38bc61b commit 34bb245

2 files changed

Lines changed: 35 additions & 22 deletions

File tree

.github/workflows/release.yml

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,53 @@ on:
44
release:
55
types: [published]
66
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: "Version to publish (e.g., 0.8.6)"
10+
required: false
11+
type: string
712

813
jobs:
914
publish:
1015
runs-on: ubuntu-latest
11-
environment: npm
16+
17+
environment: production
18+
1219
permissions:
1320
contents: read
14-
id-token: write
21+
id-token: write # Required for OIDC
1522

1623
steps:
17-
- name: Checkout code
18-
uses: actions/checkout@v5
24+
- uses: actions/checkout@v4
1925
with:
2026
submodules: recursive
2127

22-
- name: Setup Node.js
23-
uses: actions/setup-node@v5
28+
- uses: actions/setup-node@v4
2429
with:
25-
node-version: '22'
26-
registry-url: 'https://registry.npmjs.org'
30+
node-version: "22"
31+
registry-url: "https://registry.npmjs.org"
32+
scope: "@crispthinking"
2733

28-
- name: Set version from tag
34+
- name: Update npm
35+
run: npm install -g npm@latest
36+
37+
- name: Set version
2938
run: |
30-
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
39+
if [[ -n "${{ inputs.version }}" ]]; then
40+
VERSION=${{ inputs.version }}
41+
VERSION=${VERSION#v}
42+
elif [[ "$GITHUB_REF" == refs/tags/* ]]; then
3143
TAG_VERSION=${GITHUB_REF#refs/tags/}
32-
# Remove 'v' prefix if present
3344
VERSION=${TAG_VERSION#v}
34-
echo "Setting version to: $VERSION"
35-
npm --no-git-tag-version version "$VERSION"
3645
else
37-
echo "Not building from a tag, using default version"
46+
VERSION="0.0.0"
3847
fi
48+
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV
49+
npm --no-git-tag-version version "$VERSION"
50+
51+
- run: npm ci
52+
- run: npm run codegen
53+
- run: npm run build:release
3954

40-
- run: |
41-
npm ci
42-
npm run codegen
43-
npm run build:release
44-
npm publish --provenance --access public
45-
name: Build and Publish
46-
env:
47-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
55+
- name: Publish
56+
run: npm publish --provenance --access public

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
"engines": {
88
"node": ">= 22.11 < 23"
99
},
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/crispthinking/athena-nodejs-client.git"
13+
},
1014
"files": [
1115
"dist/",
1216
"README.md",

0 commit comments

Comments
 (0)