Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

Merge pull request #54 from smartcontractkit/ci-fix-publish #104

Merge pull request #54 from smartcontractkit/ci-fix-publish

Merge pull request #54 from smartcontractkit/ci-fix-publish #104

Workflow file for this run

# Dry run job split as a separate job to conditionally omit `environment`
name: Publish to NPM
on:
push:
branches:
- "**" # Run on all branches, but only publish from main
jobs:
publish-on-main:
if: github.ref_name == 'main'
runs-on: ubuntu-latest
environment: publish
permissions:
contents: read
id-token: write
steps:
- name: Checkout the repo
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: 0
- name: Setup Node 20.x
uses: actions/setup-node@v4
with:
node-version: 20.19
always-auth: true
registry-url: https://registry.npmjs.org
- name: Update npm for trusted publishing
run: npm install -g npm@latest
shell: bash
- name: Install PNPM
run: npm install -g pnpm@10
shell: bash
- name: Install dependencies
run: |
pnpm install --frozen-lockfile --strict-peer-dependencies --filter=ccip-js --filter=ccip-react-components
shell: bash
- name: Publish ccip-js to NPM
id: publish-ccip-js
continue-on-error: true
run: |
pnpm build-ccip-js
cd packages/ccip-js
pnpm publish --no-git-checks --access public
shell: bash
- name: Publish ccip-react-components to NPM
id: publish-components
continue-on-error: true
run: |
pnpm build-components
cd packages/ccip-react-components
pnpm publish --no-git-checks --access public
shell: bash
- name: Check publish results
if: steps.publish-ccip-js.outcome == 'failure' || steps.publish-components.outcome == 'failure'
run: |
echo "::error::ccip-js publish: ${{ steps.publish-ccip-js.outcome }}"
echo "::error::ccip-react-components publish: ${{ steps.publish-components.outcome }}"
exit 1
shell: bash
dry-run-publish:
if: github.ref_name != 'main'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout the repo
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: 0
- name: Setup Node 20.x
uses: actions/setup-node@v4
with:
node-version: 20.19
always-auth: true
registry-url: https://registry.npmjs.org
- name: Update npm for trusted publishing
run: npm install -g npm@latest
shell: bash
- name: Install PNPM
run: npm install -g pnpm@10
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