chore: add additional params to make it ledger compatible #16
Workflow file for this run
This file contains hidden or 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: CI/CD Pipeline | |
on: | |
push: | |
branches: [master, develop] | |
tags: ["v*.*.*", "v*.*.*-*"] | |
pull_request: | |
branches: [master] | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "22.3.0" | |
cache: "yarn" | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Run tests | |
run: yarn test | |
- name: Build TypeScript | |
run: yarn build | |
publish: | |
needs: build-and-test | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "22.3.0" | |
registry-url: "https://registry.npmjs.org" | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Build TypeScript | |
run: yarn build | |
- name: Extract tag name | |
id: tag | |
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Determine publish tag | |
id: publish_tag | |
run: | | |
if [[ "$TAG" == *-* ]]; then | |
echo "tag=dev" >> $GITHUB_OUTPUT | |
else | |
echo "tag=latest" >> $GITHUB_OUTPUT | |
fi | |
- name: Publish to npm | |
run: yarn publish --tag ${{ steps.publish_tag.outputs.tag }} | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |