Skip to content

Commit 7b1c878

Browse files
mofojedbmingles
andauthored
ci: DH-20723: Use trusted publishing for publishing packages (#2582)
- Combine the publish alpha/production packages into the same workflow - Required for trusted publishing, as you need to specify one workflow that is trusted - Removed the nightly publishing - Just do an alpha publish if you need a package published --------- Co-authored-by: Brian Ingles <[email protected]>
1 parent 89dc832 commit 7b1c878

File tree

3 files changed

+22
-90
lines changed

3 files changed

+22
-90
lines changed

.github/workflows/publish-alpha.yml

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

.github/workflows/publish-nightly.yml

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

.github/workflows/publish-packages.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1+
# This workflow publishes packages to npm using trusted publishing
2+
# It triggers on release creation to publish production packages
3+
# It can also be manually triggered to publish alpha/canary packages
14
name: Publish Packages
25
on:
3-
workflow_dispatch:
46
release:
57
types: [created]
8+
workflow_dispatch:
9+
inputs:
10+
preid:
11+
description: 'Preid used to publish package. Must be unique per branch.'
12+
required: true
13+
default: 'alpha'
14+
ref:
15+
description: 'Commit to deploy from. Defaults to branch used for workflow_dispatch action.'
16+
required: false
17+
default: ''
618
jobs:
719
publish-packages:
8-
runs-on: ubuntu-22.04
20+
runs-on: ubuntu-24.04
921
permissions:
1022
contents: read
1123
packages: write
@@ -14,7 +26,7 @@ jobs:
1426
- name: Checkout
1527
uses: actions/checkout@v4
1628
with:
17-
ref: ${{ github.ref }}
29+
ref: ${{ github.event.inputs.ref }}
1830
- name: Setup Node
1931
uses: actions/setup-node@v4
2032
with:
@@ -24,13 +36,14 @@ jobs:
2436
run: npm ci
2537
- name: Build production
2638
run: npm run build
27-
# Need the --no-verify-access access flag since we use an automation token. Otherwise publish step fails
28-
# https://github.com/lerna/lerna/issues/2788
29-
- name: Publish packages
30-
run: ./node_modules/.bin/lerna publish --no-verify-access from-package --yes
31-
env:
32-
NODE_AUTH_TOKEN: ${{ secrets.DEEPHAVENBOT_NPM_TOKEN }}
39+
- name: Publish canary packages
40+
if: ${{ github.event_name == 'workflow_dispatch' }}
41+
run: ./node_modules/.bin/lerna publish --canary --force-publish=\* --preid ${{ github.event.inputs.preid }} --dist-tag canary --yes
42+
- name: Publish production packages
43+
if: ${{ github.event_name == 'release' }}
44+
run: ./node_modules/.bin/lerna publish from-package --yes
3345
- name: Update deephaven-core
46+
if: ${{ github.event_name == 'release' }}
3447
run: |
3548
curl -L \
3649
-H "Accept: application/vnd.github+json" \

0 commit comments

Comments
 (0)