Skip to content

Commit cd76856

Browse files
committed
ci: update release action
1 parent c341438 commit cd76856

File tree

1 file changed

+39
-6
lines changed

1 file changed

+39
-6
lines changed

.github/workflows/release.yml

+39-6
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ on:
44
push:
55
branches: [main]
66

7+
concurrency: ${{ github.workflow }}-${{ github.ref }}
8+
79
jobs:
8-
release:
10+
prepare:
911
runs-on: ubuntu-latest
1012
steps:
1113
- uses: actions/checkout@v4
@@ -14,14 +16,45 @@ jobs:
1416

1517
- uses: ./.github/actions/setup
1618

17-
- name: build packs
18-
run: pnpm build
19-
2019
- name: Create versions or publish to npm registry
2120
uses: changesets/action@v1
2221
with:
23-
publish: pnpm release
24-
commit: 'ci(changeset): release milkdown'
22+
version: pnpm ci:version
23+
commit: "chore: version packages"
24+
title: "chore: version packages"
25+
createGithubReleases: false
2526
env:
2627
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
29+
publish:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
36+
- uses: ./.github/actions/setup
37+
38+
- name: build packs
39+
run: pnpm build
40+
41+
- name: Publish to NPM
42+
run: |
43+
pnpm ci:publish
44+
env:
2745
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
46+
47+
- name: Get package version
48+
run: |
49+
MILKDOWN_VERSION=$(jq -r ".version" packages/kit/package.json)
50+
echo "MILKDOWN_RELEASE_TAG=v${MILKDOWN_VERSION}" >> "$GITHUB_ENV"
51+
52+
- name: Create GitHub release
53+
uses: ncipollo/release-action@v1
54+
with:
55+
commit: main
56+
tag: "${{ env.MILKDOWN_RELEASE_TAG }}"
57+
body: "Please refer to [CHANGELOG.md](https://github.com/milkdown/milkdown/blob/${{ env.MILKDOWN_RELEASE_TAG }}/packages/kit/CHANGELOG.md) for details."
58+
token: ${{ secrets.GITHUB_TOKEN }}
59+
continue-on-error: true
60+

0 commit comments

Comments
 (0)