-
Notifications
You must be signed in to change notification settings - Fork 3
116 lines (99 loc) · 3.12 KB
/
test_n_pub.yml
File metadata and controls
116 lines (99 loc) · 3.12 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Run Tests
on:
push:
branches:
- "master"
tags:
- "v*.*.*"
pull_request:
workflow_dispatch:
jobs:
tests:
name: Python ${{ matrix.python-version }} • ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
- os: macos-latest
python-version: 3.9
- os: windows-latest
python-version: 3.9
- os: macos-latest
python-version: 3.10
- os: windows-latest
python-version: 3.10
- os: macos-latest
python-version: 3.11
- os: windows-latest
python-version: 3.11
- os: macos-latest
python-version: 3.12
- os: windows-latest
python-version: 3.12
steps:
- run: echo ${{github.ref}}
- uses: actions/checkout@v4
- name: Set up FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v3.1
with:
architecture: x64
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.arch }}
- name: Setup Python dependencies
run: |
python -m pip install -U pip
pip install -U -r tests/requirements.txt pytest-github-actions-annotate-failures
- name: Install namedpipe package
run: pip install -q .
- name: Run tests
run: pytest -vv
release:
name: Distribution
permissions: write-all
runs-on: ubuntu-latest
needs: tests
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.x" # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: Setup Python dependencies
run: |
python -m pip install -U pip setuptools
pip install -U build
- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/ .
- name: add python distribution files to release
uses: softprops/action-gh-release@v1
with:
files: dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
with:
path: ./dist
pypi-publish:
name: Upload release to PyPI
needs: release
runs-on: ubuntu-latest
# environment:
# name: pypi
# url: https://pypi.org/p/<your-pypi-project-name>
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
# retrieve your distributions to artifact folder
- uses: actions/download-artifact@v4
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: artifact/
skip-existing: true