Skip to content

ci: moidfy release.yml #277

ci: moidfy release.yml

ci: moidfy release.yml #277

Workflow file for this run

name: Release
on:
workflow_dispatch:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v3
with:
version: 8
- run: pnpm install
- run: pnpm build
- run: pnpm test
release:
name: Release
runs-on: ubuntu-latest
needs: test
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
- name: Install Dependencies
run: pnpm install
- name: Build Packages
run: pnpm build
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: git status & pnpm -r publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}