Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
package:
- md-react-preview
- vite-plugin-react-preview
- vitepress-plugin-react-preview
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
cache: pnpm
cache-dependency-path: ./pnpm-lock.yaml
node-version-file: "./package.json"
registry-url: "https://registry.npmjs.org"
- run: pnpm install
- run: pnpm build
- name: Publish @izumisy/${{ matrix.package }}
working-directory: packages/${{ matrix.package }}
run: |
PKG_NAME=$(jq -r .name package.json)
PKG_VER=$(jq -r .version package.json)
PUBLISHED=$(npm view "${PKG_NAME}@${PKG_VER}" version 2>/dev/null || echo "")
if [ "$PUBLISHED" = "$PKG_VER" ]; then
echo "Skip: ${PKG_NAME}@${PKG_VER} already published"
else
pnpm publish --no-git-checks --access public
fi
1 change: 1 addition & 0 deletions packages/md-react-preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"scripts": {
"dev": "tsdown --watch",
"build": "tsdown",
"prepublishOnly": "pnpm run build",
"type-check": "tsc --incremental",
"lint": "oxlint",
"fmt": "oxfmt --write src app/src",
Expand Down
1 change: 1 addition & 0 deletions packages/vite-plugin-react-preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"scripts": {
"dev": "tsdown --watch",
"build": "tsdown",
"prepublishOnly": "pnpm run build",
"type-check": "tsc --incremental",
"test": "vitest run"
},
Expand Down
1 change: 1 addition & 0 deletions packages/vitepress-plugin-react-preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"scripts": {
"dev": "tsdown --watch",
"build": "tsdown",
"prepublishOnly": "pnpm run build",
"type-check": "tsc --incremental",
"test": "vitest run"
},
Expand Down
Loading