Skip to content

Publish Cofhe Contracts Package to npmjs #3

Publish Cofhe Contracts Package to npmjs

Publish Cofhe Contracts Package to npmjs #3

Workflow file for this run

name: Publish Async Contracts Package to npmjs
on:
release:
types: [published]
paths:
- "cofhe-contracts/**"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: latest
run_install: false
- name: Install deps
run: pnpm install --frozen-lockfile
- name: Set publishing config
run: cd cofhe-contracts && pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Read package version
id: package_version
run: echo "VERSION=$(jq -r .version < ./cofhe-contracts/package.json)" >> $GITHUB_ENV
- name: Determine prerelease tag
id: prerelease_check
run: |
if [[ "${{ env.VERSION }}" =~ \-(alpha|beta)\.[0-9]+$ ]]; then
echo "PRERELEASE=--tag beta" >> $GITHUB_ENV
else
echo "PRERELEASE=" >> $GITHUB_ENV
fi
- run: cd cofhe-contracts && pnpm publish --no-git-checks ${{ env.PRERELEASE }}