Canary Release #120
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: Canary Release | |
on: workflow_dispatch | |
jobs: | |
publish: | |
name: Publishment | |
runs-on: ubuntu-latest | |
steps: | |
- name: Initialize git configuration | |
run: | | |
git config --global core.autocrlf false | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 # Keep `0` for getting canary release version from git history | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v3 | |
- name: Reattach HEAD to head ref | |
run: git switch -C "$(echo ${{ github.head_ref }} | sed -E 's|refs/[a-zA-Z]+/||')" | |
if: ${{ github.head_ref != '' }} | |
- name: Reattach HEAD to ref | |
run: git switch -C "$(echo ${{ github.ref }} | sed -E 's|refs/[a-zA-Z]+/||')" | |
if: ${{ github.head_ref == '' }} | |
- name: Setup Node environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
architecture: x64 | |
registry-url: https://registry.npmjs.org/ | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: | | |
pnpm install | |
- name: Build packages | |
run: | | |
pnpm build | |
- name: Publish canary release to NPM registry | |
if: startsWith(github.event.head_commit.message, 'chore') == false | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc | |
pnpm canary |