-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (58 loc) · 2.07 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Build + Release Wheels
on:
workflow_dispatch:
inputs:
deploy_to_testpypi:
description: "Whether the build should be deployed to test.pypi.org instead of regular PyPI"
required: true
default: false
jobs:
build-and-release:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup Dependencies (Windows)
if: runner.os == 'Windows'
run: echo "No extra setup needed for Windows"
shell: bash
- name: Setup Dependencies (macOS)
if: runner.os == 'macOS'
run: echo "No extra setup needed for macOS"
shell: bash
- name: Build native binary (Windows)
if: runner.os == 'Windows'
run: make vinput.lib
shell: bash
- name: Build native binary (macOS)
if: runner.os == 'macOS'
run: make libvinput.dylib
shell: bash
- name: Build wheel
run: |
pip install build
python -m build --wheel
- uses: actions/upload-artifact@v4
with:
name: python-package-distributions-${{ matrix.os }}-py${{ matrix.python-version }}
path: dist
- name: Install Twine
run: pip install twine
- name: Upload to PyPI
if: github.event.inputs.deploy_to_testpypi == 'false'
run: twine upload dist/* --verbose --skip-existing -u __token__ -p ${{ secrets.PYPI_API_TOKEN }}
env:
TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/
- name: Upload to TestPyPI
if: github.event.inputs.deploy_to_testpypi == 'true'
run: twine upload dist/* --verbose --skip-existing -u __token__ -p ${{ secrets.TEST_PYPI_API_TOKEN }}
env:
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/