Skip to content

Commit 4517470

Browse files
committed
[ci] add semantic-release
1 parent dd0b81c commit 4517470

File tree

2 files changed

+42
-16
lines changed

2 files changed

+42
-16
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,14 @@ jobs:
2121
- name: Zip
2222
run : |
2323
zip -r slowlog_check.zip ./*
24-
- name: Create Release
25-
id: create_release
26-
uses: actions/create-release@v1
24+
- name: Semantic Release
25+
id: semantic
26+
uses: cycjimmy/semantic-release-action@v2
2727
env:
2828
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2929
with:
30-
tag_name: ${{ github.ref }}
31-
release_name: Release ${{ github.ref }}
32-
draft: true
33-
prerelease: true
34-
- name: Upload Release Asset
35-
uses: actions/upload-release-asset@v1
36-
env:
37-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38-
with:
39-
upload_url: ${{ steps.create_release.outputs.upload_url }}
40-
asset_path: ./slowlog_check.zip
41-
asset_name: slowlog_check-${{ github.ref }}.zip
42-
asset_content_type: application/zip
30+
semantic_version: 17
31+
# You can specify specifying version range for the extra plugins if you prefer.
32+
extra_plugins: |
33+
@semantic-release/[email protected]
34+
@semantic-release/git

release.config.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
module.exports = {
2+
"dryRun": false,
3+
"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+
"@semantic-release/github",
14+
{
15+
"assets": [
16+
{
17+
"path": "slowlog_check.zip",
18+
"name": "slowlog_check.${nextRelease.version}.zip",
19+
"label": "Full zip distribution"
20+
}
21+
]
22+
}
23+
],
24+
[
25+
"@semantic-release/git",
26+
{
27+
"assets": [
28+
"CHANGELOG.md"
29+
],
30+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
31+
}
32+
]
33+
]
34+
};

0 commit comments

Comments
 (0)