Skip to content

Commit fe20f5c

Browse files
artemrysArtem Rys
authored and
Artem Rys
committed
feat: add Github release
1 parent 224c327 commit fe20f5c

File tree

2 files changed

+107
-0
lines changed

2 files changed

+107
-0
lines changed

.github/workflows/build-test.yml renamed to .github/workflows/build-test-release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,53 @@ jobs:
5656
uses: actions/checkout@v2
5757
- name: Check License Header
5858
uses: apache/skywalking-eyes@main
59+
60+
publish:
61+
name: Build Release
62+
needs:
63+
- compliance-copyrights
64+
- pre-commit
65+
- test-unit
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v2
69+
with:
70+
submodules: false
71+
# Very important: semantic-release won't trigger a tagged
72+
# build if this is not set false
73+
persist-credentials: false
74+
- name: Setup python
75+
uses: actions/setup-python@v2
76+
with:
77+
python-version: "3.7"
78+
- name: Install Poetry
79+
run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 -
80+
- name: Install Code
81+
run: |
82+
# shellcheck disable=SC1090
83+
source "$HOME/.poetry/env"
84+
poetry install
85+
- name: Build
86+
run: |
87+
# shellcheck disable=SC1090
88+
source "$HOME/.poetry/env"
89+
poetry build
90+
- name: Semantic Release
91+
uses: cycjimmy/[email protected]
92+
with:
93+
semantic_version: 17
94+
extra_plugins: |
95+
@semantic-release/exec
96+
@semantic-release/git
97+
@google/semantic-release-replace-plugin
98+
env:
99+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_ADMIN }}
100+
101+
update-semver:
102+
name: Move Respository semver tags
103+
if: startsWith(github.ref, 'refs/tags/v')
104+
needs: publish
105+
runs-on: ubuntu-latest
106+
steps:
107+
- uses: actions/checkout@v2
108+
- uses: haya14busa/action-update-semver@v1

.releaserc

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#
2+
# Copyright 2021 Splunk Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
{
17+
branches:
18+
[
19+
"+([0-9])?(.{+([0-9]),x}).x",
20+
"main",
21+
{ name: "develop", prerelease: "beta", channel: "beta" },
22+
],
23+
plugins:
24+
[
25+
"@semantic-release/commit-analyzer",
26+
[
27+
"@google/semantic-release-replace-plugin",
28+
{
29+
"replacements": [
30+
{
31+
"files": ["pyproject.toml"],
32+
"from": "version ?=.*",
33+
"to": "version = \"${nextRelease.version}\"",
34+
"results": [
35+
{
36+
"file": "pyproject.toml",
37+
"hasChanged": true,
38+
"numMatches": 1,
39+
"numReplacements": 1
40+
}
41+
],
42+
"countMatches": true
43+
}
44+
]
45+
}
46+
],
47+
"@semantic-release/release-notes-generator",
48+
[
49+
"@semantic-release/git",
50+
{
51+
"assets": [pyproject.toml"],
52+
"message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}",
53+
},
54+
],
55+
["@semantic-release/github", { "assets": [pyproject.toml"] }],
56+
],
57+
}

0 commit comments

Comments
 (0)