chore: node@22 #366
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
# Automatically cancel in-progress actions on the same branch | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }} | |
cancel-in-progress: true | |
# Cancel previous running workflow in case of a new push | |
# concurrency: | |
# group: ci-${{ github.head_ref || 'main' }} | |
# cancel-in-progress: true | |
jobs: | |
build: | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN || '' }} | |
HUSKY: 0 | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# - name: Install pnpm | |
# uses: pnpm/action-setup@v2 | |
# id: pnpm-install | |
# with: | |
# version: 8 | |
# run_install: false | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
# cache: 'pnpm' | |
registry-url: 'https://registry.npmjs.org' | |
- name: 📥 Monorepo install | |
uses: ./.github/actions/pnpm-install | |
- name: 'Lint' | |
run: pnpm run lint | |
# - name: 'NPM Identity' | |
# run: | | |
# echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc | |
- name: Create Release Pull Request or Publish to npm | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
version: pnpm ci:version | |
commit: 'chore: update versions' | |
title: 'chore: update versions' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish | |
if: steps.changesets.outputs.hasChangesets == 'false' | |
# You can do something when a publish should happen. | |
run: pnpm ci:publish | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# Publish to NPM | |
- name: Publish Latest Release | |
if: github.event_name == 'release' && github.event.release.prerelease == false && env.NODE_AUTH_TOKEN != '' | |
run: pnpm run publish-ci | |
# Publish to NPM with prerelease dist-tag | |
- name: Publish Latest Prerelease | |
if: github.event_name == 'release' && github.event.release.prerelease && env.NODE_AUTH_TOKEN != '' | |
run: pnpm run publish-ci --dist-tag prerelease |