-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
白云苍狗
committed
Oct 30, 2023
1 parent
7faf3a5
commit 0b9d7b3
Showing
18 changed files
with
63 additions
and
21 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: NPM Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- "cli-v*" | ||
jobs: | ||
build: | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
registry-url: "https://registry.npmjs.org" | ||
cache: yarn | ||
- run: yarn install --frozen-lockfile | ||
|
||
- name: Build | ||
run: | | ||
node ./scripts/publish.mjs | ||
cd ./packages/create-theme | ||
npm run build | ||
npm publish | ||
env: | ||
RELEASE_VERSION: ${{ github.ref }} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# vitepress theme async | ||
|
||
```bash | ||
# npm | ||
npm create async-theme@latest my-first-blog | ||
|
||
# yarn | ||
yarn create async-theme my-first-blog | ||
|
||
# pnpm | ||
pnpm create async-theme my-first-blog | ||
|
||
# bun | ||
bunx create-async-theme my-first-blog --bun | ||
``` |
5 changes: 3 additions & 2 deletions
5
packages/async-cli/package.json → packages/create-theme/package.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
{ | ||
"name": "async-cli", | ||
"name": "create-async-theme", | ||
"version": "0.0.0", | ||
"repository": "[email protected]:MaLuns/vitepress-theme-async.git", | ||
"author": "白云苍狗 <[email protected]>", | ||
"license": "MIT", | ||
"keywords": [ | ||
"vitepress-theme", | ||
"blog-theme" | ||
"blog-theme", | ||
"create-theme" | ||
], | ||
"bin": { | ||
"async-cli": "./dist/index.js" | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import { writeFileSync } from "fs"; | ||
import { resolve } from "path"; | ||
import { fileURLToPath } from "url"; | ||
import pkg from "../packages/vitepress-theme-async/package.json" assert { type: "json" }; | ||
import themepkg from "../packages/vitepress-theme-async/package.json" assert { type: "json" }; | ||
import clipkg from "../packages/create-theme/package.json" assert { type: "json" }; | ||
|
||
|
||
if (process.env.RELEASE_VERSION) { | ||
const version = process.env.RELEASE_VERSION.split("/").reverse()[0]; | ||
console.log("当前版本:", version); | ||
pkg.version = version.replace("v", ""); | ||
writeFileSync(resolve(fileURLToPath(import.meta.url), "../../packages/vitepress-theme-async/package.json"), JSON.stringify(pkg, null, 4), "utf-8"); | ||
themepkg.version = version.replace("v", ""); | ||
clipkg.version = version.replace("cli-v", ""); | ||
writeFileSync(resolve(fileURLToPath(import.meta.url), "../../packages/vitepress-theme-async/package.json"), JSON.stringify(themepkg, null, 4), "utf-8"); | ||
writeFileSync(resolve(fileURLToPath(import.meta.url), "../../packages/create-theme/package.json"), JSON.stringify(clipkg, null, 4), "utf-8"); | ||
} |