Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 50 additions & 7 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# NOTE: See "prepublishOnly" script in package.json
# NPM_TOKEN will only be populated in the context of the `publish` GH environment, see L14
# Dry run job split as a separate job to conditionally omit `environment`

name: Publish to NPM

on:
push:
branches:
- "main"
- "**" # Run on all branches, but only publish from main

jobs:
build-and-publish:
publish-on-main:
if: github.ref_name == 'main'
runs-on: ubuntu-latest
environment: publish
permissions:
contents: read
steps:
- name: Checkout the repo
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
Expand All @@ -29,22 +32,62 @@
shell: bash

- name: Install dependencies
run:
run: |
pnpm install --frozen-lockfile --strict-peer-dependencies --filter=ccip-js --filter=ccip-react-components
shell: bash
shell: bash

- name: Publish ccip-js to NPM
run: |
pnpm build-ccip-js
cd packages/ccip-js
pnpm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_CCIP_JS }}
pnpm publish --no-git-checks --access public
shell: bash
shell: bash

- name: Publish ccip-react-components to NPM
run: |
pnpm build-components
cd packages/ccip-react-components
pnpm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_CCIP_REACT_COMPONENTS }}
pnpm publish --no-git-checks --access public
shell: bash
shell: bash

dry-run-publish:
if: github.ref_name != 'main'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout the repo
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: 0

- name: Setup Node 18.x
uses: actions/setup-node@v3

Check warning on line 67 in .github/workflows/publish.yaml

View workflow job for this annotation

GitHub Actions / Validate Workflow Changes

1. Action is using node16 (node-version / warning)
with:
node-version: 18.12
always-auth: true

- name: Install PNPM
run: npm install -g pnpm@9.4.0
shell: bash

- name: Install dependencies
run: |
pnpm install --frozen-lockfile --strict-peer-dependencies --filter=ccip-js --filter=ccip-react-components
shell: bash

- name: Dry-run publish ccip-js
run: |
pnpm build-ccip-js
cd packages/ccip-js
pnpm publish --no-git-checks --access public --dry-run
shell: bash

- name: Dry-run publish ccip-react-components
run: |
pnpm build-components
cd packages/ccip-react-components
pnpm publish --no-git-checks --access public --dry-run
shell: bash
Loading