support react 18 and 19 #44
Workflow file for this run
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 | |
tags: | |
- "v*" | |
pull_request: | |
jobs: | |
install: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
name: Node | |
steps: | |
- name: Checkout Code | |
uses: actions/[email protected] | |
- name: Use Node 18 and pnpm | |
uses: actions/[email protected] | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Cache Dependencies | |
uses: actions/[email protected] | |
- name: Install Dependencies | |
run: pnpm install --frozen-lockfile | |
release: | |
runs-on: ubuntu-latest | |
needs: [install] | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
steps: | |
- name: Checkout Code | |
uses: actions/[email protected] | |
- name: Use Node 18 and pnpm | |
uses: actions/[email protected] | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Restore Cached Dependencies | |
uses: actions/[email protected] | |
- name: Determine tag | |
id: determine_tag | |
run: | | |
echo "tag=$(echo $GITHUB_REF | grep -Eo 'alpha|beta|rc')" >> $GITHUB_OUTPUT | |
- name: Add auth token to npmrc | |
run: | | |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc | |
- name: Publish to versioned tag | |
if: steps.determine_tag.outputs.tag != '' | |
run: | | |
echo "Publishing to ${{ steps.determine_tag.outputs.tag }} tag" | |
pnpm publish --tag ${{ steps.determine_tag.outputs.tag }} | |
- name: Publish to latest | |
if: steps.determine_tag.outputs.tag == '' | |
run: | | |
echo "Publishing to latest" | |
pnpm publish |