Skip to content

Commit 2a0f01b

Browse files
authored
fix: add conditions to determine whether to publish (#3)
* ci: add ci to auto release * fix: ci add cache to support pnpm * fix: ` npm install -g pnpm` support pnpm * ci: build * chore:尝试发布 * chore: 更新说明 * chore: 调整版本发布
1 parent 3d39988 commit 2a0f01b

File tree

6 files changed

+62
-4
lines changed

6 files changed

+62
-4
lines changed

.changeset/breezy-otters-juggle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"@cherry-markdown/changesets-changelog-github": patch
33
---
44

5-
feat: 使用 `tsdown` 构建项目
5+
feat: use `tsdown` dev build

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"fixed": [],
66
"linked": [],
77
"access": "restricted",
8-
"baseBranch": "dev",
8+
"baseBranch": "main",
99
"updateInternalDependencies": "patch",
1010
"ignore": []
1111
}

.changeset/fluffy-seas-fly.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cherry-markdown/changesets-changelog-github": patch
3+
---
4+
5+
ci: add ci to auto release

.github/workflows/release.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Repo
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Node.js 20.x
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: 20.x
19+
registry-url: "https://registry.npmjs.org"
20+
21+
- name: Install dependencies
22+
run: |
23+
npm install -g pnpm
24+
pnpm install
25+
pnpm run build
26+
27+
- name: Check for changesets
28+
id: changesets
29+
uses: changesets/action@v1
30+
with:
31+
version: npx @changesets/cli version
32+
title: "chore: release"
33+
commit: "chore: release"
34+
publish: pnpm changeset tag
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Publish @cherry-markdown/changesets-changelog-github
39+
if: ${{ contains(steps.changesets.outputs.publishedPackages, '"name":"@cherry-markdown/changesets-changelog-github"') }}
40+
run: |
41+
cd packages/changesets-changelog-github
42+
npm publish --access public
43+
env:
44+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
45+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
11
# @cherry-markdown/changesets-changelog-github
2+
3+
## Usage
4+
5+
in `.changeset\config.json`
6+
7+
```json
8+
"changelog": ["@cherry-markdown/changesets-changelog-github", {"repo": "cherry-markdown/changesets-changelog-github"}],
9+
```

packages/changesets-changelog-github/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cherry-markdown/changesets-changelog-github",
3-
"version": "0.0.1",
3+
"version": "0.0.0",
44
"main": "dist/index.cjs",
55
"module": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -22,7 +22,7 @@
2222
"homepage": "https://github.com/cherry-markdown/changesets-changelog-github#readme",
2323
"scripts": {
2424
"dev": "tsdown",
25-
"build": "tsdown build"
25+
"build": "tsdown"
2626
},
2727
"dependencies": {
2828
"@changesets/get-github-info": "^0.6.0",

0 commit comments

Comments
 (0)