-
Notifications
You must be signed in to change notification settings - Fork 4
69 lines (60 loc) · 2.04 KB
/
release.yaml
File metadata and controls
69 lines (60 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Release
on:
push:
tags:
- v*
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
# 此步骤使用 GitHub 的 https://github.com/actions/checkout
- uses: actions/checkout@v3
# 设置python环境
# 此步骤使用 GitHub 的 https://github.com/actions/setup-python
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Build Assets
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
python setup.py sdist bdist_wheel
ls -lh
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
with:
# Optionally strip `v` prefix
strip_v: true
# - name: conventional changelog action
# id: changelog
# # https://github.com/TriPSs/conventional-changelog-action
# uses: TriPSs/conventional-changelog-action@latest
# with:
# # you can also create separate token to trace action
# github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
# body: ${{steps.changelog.outputs.clean_changelog}}
draft: false
prerelease: false
- name: Upload assets
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/${{ github.event.repository.name }}-${{steps.tag.outputs.tag}}-py3-none-any.whl
asset_name: ${{ github.event.repository.name }}-${{steps.tag.outputs.tag}}-py3-none-any.whl
asset_content_type: application/zip