Skip to content

Commit 00a5a55

Browse files
authored
Merge pull request #74 from luzhongyang/master
add version
2 parents 3c8e1da + f4e14af commit 00a5a55

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

.github/workflows/release-agent.yml

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,43 @@ jobs:
2020
with:
2121
python-version: "3.9"
2222

23-
- name: Package
23+
- name: Get release
24+
id: get_release
25+
uses: bruceadams/[email protected]
26+
env:
27+
GITHUB_TOKEN: ${{ github.token }}
28+
29+
- name: Get python version
30+
id: get_python_version
2431
run: |
25-
python setup.py sdist
32+
V=`echo ${{ steps.get_release.outputs.tag_name }} | sed -e's/v//g' | sed -e's/V//g'`; \
33+
echo ::set-output name=VERSION::${V}
34+
35+
- name: Generate version file
36+
run: |
37+
cd ${{ github.workspace }} && \
38+
echo "${{ github.event.repository.name }},version,${{ steps.get_python_version.outputs.VERSION }}" >> version.txt && \
39+
echo "${{ github.event.repository.name }},commit_hash,${GITHUB_SHA}" >> version.txt
40+
41+
- name: Replace setup cfg
42+
run: |
43+
sed -i -e 's/version = .*$/version = ${{ steps.get_python_version.outputs.VERSION }}/g' setup.cfg
44+
cat setup.cfg
45+
46+
- name: Upload version file to oss
47+
id: upload_version_file_to_oss
48+
uses: tvrcgo/upload-to-oss@master
49+
with:
50+
key-id: ${{ secrets.OSS_KEY_ID }}
51+
key-secret: ${{ secrets.OSS_KEY_SECRET }}
52+
region: oss-cn-beijing
53+
bucket: huoqi-public
54+
assets: |
55+
./version.txt:/iast/release-version/${{ github.event.repository.name }}/${{ steps.get_python_version.outputs.VERSION }}/version.txt
2656
57+
- name: Package
58+
run: |
59+
python setup.py sdist
2760
- uses: manyuanrong/[email protected]
2861
with:
2962
endpoint: "oss-cn-beijing.aliyuncs.com"

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ include dongtai_agent_python/cli/*.py
66
include dongtai_agent_python/common/*.py
77
include dongtai_agent_python/report/*.py
88
include dongtai_agent_python/middlewares/*.py
9+
include version.txt

0 commit comments

Comments
 (0)