-
Notifications
You must be signed in to change notification settings - Fork 4
50 lines (42 loc) · 1.19 KB
/
release.yaml
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
name: Release
on:
push:
tags:
- 'v*.*.*'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
architecture: 'x64'
- name: Install flit
run: pip install flit
- name: Build
run: flit build
- name: Publish to PyPI
env:
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
flit publish
- name: Create a GitHub Release
id: create_release
if: startsWith(github.ref, 'refs/tags/')
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
allowUpdates: true
replacesArtifacts: true
tag: ${{ github.event.release.tag_name }}
name: Release ${{ github.event.release.tag_name }}
commit: main
body: Release ${{ github.event.release.tag_name }}
token: ${{ secrets.GITHUB_TOKEN }}