-
-
Notifications
You must be signed in to change notification settings - Fork 10
82 lines (71 loc) · 2.51 KB
/
test-and-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
71
72
73
74
75
76
77
78
79
80
81
82
name: 'Test and Release Yakut'
on: [ push, pull_request ]
# Ensures that only one workflow is running at a time - required for duplicate pushes and repushing a PR
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
yakut-test:
name: Test Yakut
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-2019-npcap]
python: ['3.8', '3.9', '3.10']
exclude:
- os: windows-2019-npcap
python: 3.8
- os: windows-2019-npcap
python: 3.9
runs-on: ${{ matrix.os }}
steps:
- name: Check out
uses: actions/checkout@v3
- name: Install Python3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Log Python version
run: python --version
- name: Install dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get --ignore-missing update || true
sudo apt-get install -y linux-*-extra-$(uname -r) ncat
sudo apt-get install -y libsdl2-2.0-0 # For PySDL2. On Windows/macOS the binaries are pulled from PyPI.
sudo apt-get install -y libasound2-dev # For RtMidi.
fi
git submodule update --init --recursive
python -m pip install --upgrade pip setuptools nox
shell: bash
- name: Run build and test
run: |
nox --non-interactive --session test --python ${{ matrix.python }}
nox --non-interactive --session lint
yakut-release:
name: Release Yakut
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, '#release') || contains(github.ref, '/main')
needs: yakut-test
steps:
- name: Check out
uses: actions/checkout@v3
- name: Create distribution wheel
run: |
git submodule update --init --recursive
python -m pip install --upgrade pip setuptools wheel twine
python setup.py sdist bdist_wheel
- name: Get release version
run: echo "yakut_version=$(cat yakut/VERSION)" >> $GITHUB_ENV
- name: Upload distribution
run: |
python -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN_YAKUT }}
- name: Push version tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ env.yakut_version }}
tag_prefix: ''