Skip to content

v2.3.1-canary

v2.3.1-canary #66

Workflow file for this run

name: Release
on:
release:
types:
- published
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set env
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: pnpm/action-setup@v2
with:
version: latest
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Set package version
run: echo $(jq --arg v "${{ env.VERSION }}" '(.version) = $v' package.json) > package.json
- name: Install
run: pnpm install
- name: Build package
run: pnpm build
- name: Authenticate Registry
run: npm set "//registry.npmjs.org/:_authToken" ${{ secrets.NPM_TOKEN }}
- name: Publish canary
if: "github.event.release.prerelease"
run: pnpm publish --access public --tag=canary --no-git-checks
- name: Publish
if: "!github.event.release.prerelease"
run: pnpm publish --access public --no-git-checks