-
Notifications
You must be signed in to change notification settings - Fork 9
47 lines (39 loc) · 1.12 KB
/
build_and_upload_release.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
name: build_and_upload_release
on:
release:
types:
- published
pull_request:
branches:
- dev
- master
jobs:
build:
name: build and upload release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up python
uses: actions/setup-python@v5
- name: setup poetry
run: |
python -m pip install --upgrade pip poetry
- name: build wheels and test uploading to pypi
if: startsWith(github.ref, 'refs/tags/v') != true
run: |
python -m poetry --build publish --dry-run
- name: build wheels and upload to pypi
if: startsWith(github.ref, 'refs/tags/v')
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: |
python -m poetry --build publish
- name: upload binaries into release
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*
tag: ${{ github.ref }}
overwrite: true
file_glob: true