Skip to content

Commit beb9d7f

Browse files
authored
Create main.yml
1 parent 7284f68 commit beb9d7f

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: PyPI publish CI
4+
5+
# Controls when the workflow will run
6+
on:
7+
push:
8+
# 每次 push tag 时进行构建,不需要每次 push 都构建。使用通配符匹配每次 tag 的提交,记得 tag 名一定要以 v 开头
9+
tags:
10+
- v*
11+
# on:
12+
# # Triggers the workflow on push or pull request events but only for the master branch
13+
# push:
14+
# branches: [ master ]
15+
# pull_request:
16+
# branches: [ master ]
17+
18+
# Allows you to run this workflow manually from the Actions tab
19+
workflow_dispatch:
20+
21+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
22+
jobs:
23+
# This workflow contains a single job called "build"
24+
build:
25+
# The type of runner that the job will run on
26+
runs-on: ubuntu-latest
27+
28+
# Steps represent a sequence of tasks that will be executed as part of the job
29+
steps:
30+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
31+
- uses: actions/checkout@v2
32+
33+
# Runs a single command using the runners shell
34+
- name: Run a one-line script
35+
run: echo Hello, world!
36+
37+
38+
- name: Publish package to PyPI
39+
uses: pypa/gh-action-pypi-publish@release/v1
40+
with:
41+
user: __token__
42+
password: ${{ secrets.PYPI_API_TOKEN }}
43+
44+
45+
# Runs a set of commands using the runners shell
46+
- name: Run a multi-line script
47+
run: |
48+
echo Add other actions to build,
49+
echo test, and deploy your project.

0 commit comments

Comments
 (0)