-
Notifications
You must be signed in to change notification settings - Fork 975
62 lines (53 loc) · 1.71 KB
/
publish.yml
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
name: Publish
on:
# 当master分支有push时,触发action
push:
tags:
- 'v*' # 以 'v' 开头的标签触发工作流程
jobs:
publish:
name: Publish Pypi and Create Release
if: github.repository == 'xaoyaoo/PyWxDump' # 仅在指定仓库的 tag 触发工作流程
# 此作业在 Linux 上运行
runs-on: windows-latest
steps:
- name: Checkout repository # 检出仓库
uses: actions/checkout@v2 # 使用 GitHub 官方的 checkout action
- run: |
git fetch --prune --unshallow
- name: Set up Python # 设置 Python 环境
uses: actions/setup-python@v2 # 使用 GitHub 官方的 setup-python action
with:
python-version: 3.8 # 指定 Python 版本 (3.8)
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
python -m pip install --upgrade twine
- name: Build package
run: python -m build
- name: Publish package with Twine
run: |
twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_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: Release ${{ github.ref }}
body: |
[Auto Release] Update PyWxDump
draft: false
prerelease: false
- name: Upload .whl file
uses: actions/upload-artifact@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: wheel
path: dist/*.whl