Skip to content

Commit 70b3885

Browse files
committed
ci: update semantic release configuration
1 parent 4d9db86 commit 70b3885

2 files changed

Lines changed: 32 additions & 39 deletions

File tree

.github/workflows/release-package.yml

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,27 @@ jobs:
1313
name: Check release
1414
steps:
1515
- name: Checkout repository
16-
uses: actions/checkout@v1
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
persist-credentials: false
20+
21+
- name: Get release token
22+
id: get-token
23+
uses: actions/create-github-app-token@v1
24+
with:
25+
app-id: ${{ secrets.APP_ID }}
26+
private-key: ${{ secrets.APP_SECRET }}
1727

1828
- name: Semantic Release
1929
uses: cycjimmy/semantic-release-action@v3
2030
id: semantic
2131
with:
2232
extra_plugins: |
23-
conventional-changelog-conventionalcommits
24-
env:
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26-
27-
- name: Get token
28-
if: steps.semantic.outputs.new_release_published == 'true'
29-
id: get_token
30-
uses: actions/create-github-app-token@v1
31-
with:
32-
app-id: ${{ secrets.APP_ID }}
33-
private-key: ${{ secrets.APP_SECRET }}
34-
35-
- name: Commit changes
36-
if: steps.semantic.outputs.new_release_published == 'true'
33+
@semantic-release/changelog@6.0.3
34+
@semantic-release/git@10.0.1
3735
env:
38-
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
39-
FILE_TO_COMMIT: CHANGELOG.md
40-
DESTINATION_BRANCH: ${{ github.ref }}
41-
run: |
42-
cat CHANGELOG.md
43-
# export MESSAGE="chore: update $FILE_TO_COMMIT"
44-
# export SHA=$( git rev-parse $DESTINATION_BRANCH:$FILE_TO_COMMIT )
45-
# export CONTENT=$( base64 -i $FILE_TO_COMMIT )
46-
# gh api --method PUT /repos/:owner/:repo/contents/$FILE_TO_COMMIT \
47-
# --field message="$MESSAGE" \
48-
# --field content="$CONTENT" \
49-
# --field encoding="base64" \
50-
# --field branch="$DESTINATION_BRANCH" \
51-
# --field sha="$SHA"
36+
GITHUB_TOKEN: ${{ steps.get-token.outputs.token }}
5237

5338
outputs:
5439
trigger_release: ${{ steps.semantic.outputs.new_release_published }}

release.config.js

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
module.exports = {
22
branches: ["v2", "vnext"],
33
plugins: [
4-
"@semantic-release/commit-analyzer",
5-
"@semantic-release/release-notes-generator",
6-
[
7-
"@semantic-release/changelog",
8-
{
9-
"changelogFile": "CHANGELOG.md"
10-
}
11-
],
12-
]
13-
}
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
[
7+
"@semantic-release/changelog",
8+
{
9+
changelogFile: "CHANGELOG.md",
10+
changelogTitle: "# Changelog\n\nPackage versions follow this library's semantic versioning and do not correspond directly to AsyncAPI specification versions. For example, package 2.0.0 introduced the AsyncAPI 3.0 object model, while package 3.0.0 later moved V3 document output to AsyncAPI 3.1.0.",
11+
},
12+
],
13+
[
14+
"@semantic-release/git",
15+
{
16+
assets: ["CHANGELOG.md"],
17+
message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
18+
},
19+
],
20+
],
21+
};

0 commit comments

Comments
 (0)