-
Notifications
You must be signed in to change notification settings - Fork 11
73 lines (61 loc) · 1.57 KB
/
Copy pathrelease.yml
File metadata and controls
73 lines (61 loc) · 1.57 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
name: CI
on:
push:
branches: [master]
pull_request:
release:
types: [published]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
test:
name: Test on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.11"]
steps:
- uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v8.3.2
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Run tests
run: uv run --extra test pytest
build:
name: Build distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v8.3.2
with:
enable-cache: true
- name: Build sdist and wheel
run: uv build
- uses: actions/upload-artifact@v7
with:
name: dist
path: ./dist/*
publish:
name: Publish to PyPI
needs: [test, build]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.repository == 'TkTech/PyNBT'
environment:
name: pypi
url: https://pypi.org/p/PyNBT
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
name: dist
path: dist
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1