Skip to content

Commit

Permalink
chore: Action to automatically update deephaven-core when new web ver…
Browse files Browse the repository at this point in the history
…sions published (#1138)

- Trigger the
[update-web](https://github.com/deephaven/deephaven-core/blob/main/.github/workflows/update-web.yml)
action on `deephaven-core` when publishing new web-client-ui packages is
done
- Uses [workflow_dispatch REST
API](https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28)
to trigger it
- Requires a Classic token with `public_repo` permissions to trigger the
`deephaven-core` action
  - Token is named `DEEPHAVENINTERNAL_PUBLIC_TOKEN`
- I've added a [comment on the fine-grained token
discussion](community/community#36441 (comment))
to see if there's a fine-grained version of the token that will suffice
in the future
  • Loading branch information
mofojed authored Mar 8, 2023
1 parent 7448a88 commit 46c5e24
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,29 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- uses: actions/setup-node@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- name: Install dependencies
run: npm ci
- name: Build production
run: npm run build
# Need the --no-verify-access access flag since we use an automation token. Otherwise publish step fails
# https://github.com/lerna/lerna/issues/2788
- run: ./node_modules/.bin/lerna publish --no-verify-access from-package --yes
- name: Publish packages
run: ./node_modules/.bin/lerna publish --no-verify-access from-package --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.DEEPHAVENBOT_NPM_TOKEN }}
- name: Update deephaven-core
run: |
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.DEEPHAVENINTERNAL_PUBLIC_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/deephaven/deephaven-core/actions/workflows/update-web.yml/dispatches --data '{"ref": "main"}'

0 comments on commit 46c5e24

Please sign in to comment.