Skip to content

chore(main): release 1.4.2 (#284) #308

chore(main): release 1.4.2 (#284)

chore(main): release 1.4.2 (#284) #308

name: Continuous Delivery
on:
push:
branches:
- main
workflow_dispatch:
inputs:
prNumber:
description: The number of the PR that is being deployed
required: true
ref:
description: The branch that is being deployed. Should be a branch on the given repository
required: false
default: main
jobs:
Publish:
name: Publish Dev to npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Use Node.js v18
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3
with:
node-version: "18.x"
cache: yarn
registry-url: https://registry.yarnpkg.com/
- name: Install dependencies
run: yarn --immutable
- name: Bump Version & Publish
run: |
# Resolve the tag to be used. "dev" for push events, "pr-{prNumber}" for dispatch events.
TAG=$([[ ${{ github.event_name }} == 'push' ]] && echo 'dev' || echo 'pr-${{ github.event.inputs.prNumber }}')
yarn config set npmAuthToken ${NODE_AUTH_TOKEN}
yarn config set npmPublishRegistry "https://registry.yarnpkg.com"
yarn bump --preid "${TAG}.$(git rev-parse --verify --short HEAD)"
yarn npm publish --tag ${TAG}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}