Skip to content

Commit

Permalink
ci: split workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zce committed Nov 24, 2023
1 parent 6015bf7 commit c839aee
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,3 @@ jobs:
cache: pnpm
- run: pnpm install
- run: pnpm build

publish:
if: startsWith(github.ref, 'refs/tags')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm
- run: pnpm install
- run: pnpm build
- run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish

on:
push:
tags:
- v*

jobs:
publish:
# prevents this action from running on forks
if: github.repository == 'zce/velite'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm
- run: pnpm install
- run: pnpm build
- run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "velite",
"version": "0.1.0-alpha.37",
"version": "0.1.0-alpha.36",
"description": "Turns Markdown, YAML, JSON, or other files into app's data layer with typesafe schema.",
"keywords": [
"content",
Expand Down

0 comments on commit c839aee

Please sign in to comment.