Publish Cofhe Contracts Package to npmjs #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |