v0.7.0 #1
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: NPM Publish | |
on: | |
release: | |
types: [created] | |
jobs: | |
publish-npm: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
registry-url: https://registry.npmjs.org/ | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: latest | |
- name: Cache pnpm modules | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.pnpm-store | |
node_modules | |
src/playground/node_modules | |
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm- | |
- name: Install Full Project | |
run: pnpm install --frozen-lockfile | |
- name: Build Full Project | |
run: pnpm run build | |
- name: Set Package Version to Tag | |
run: | | |
VERSION=${GITHUB_REF#refs/tags/} | |
pnpm version $VERSION --no-git-tag-version | |
- name: Publish | |
run: | | |
if [[ "${GITHUB_REF#refs/tags/}" == *-* ]]; then | |
npm publish --access public --tag next | |
else | |
npm publish --access public | |
fi | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |