-
Notifications
You must be signed in to change notification settings - Fork 120
88 lines (75 loc) · 2.22 KB
/
Copy pathaiscat-release.yml
File metadata and controls
88 lines (75 loc) · 2.22 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
name: aiscat — release wheels
on:
workflow_dispatch:
inputs:
target:
description: "Which index to publish to"
required: true
default: "testpypi"
type: choice
options: [testpypi, pypi]
push:
tags: ["aiscat-v*.*.*"]
jobs:
build_wheels:
name: Build wheels (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-14, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@v3.4.1
with:
package-dir: python
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install build
run: python -m pip install build
- name: Vendor upstream Source/ into python/
working-directory: python
run: python scripts/prepare_sdist.py
- name: Build sdist
working-directory: python
run: python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: python/dist/*.tar.gz
upload:
name: Upload to ${{ inputs.target || 'pypi' }}
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment:
name: ${{ inputs.target || 'pypi' }}
url: ${{ inputs.target == 'testpypi' && 'https://test.pypi.org/p/aiscat' || 'https://pypi.org/p/aiscat' }}
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Publish to TestPyPI
if: inputs.target == 'testpypi'
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: dist
- name: Publish to PyPI
if: github.event_name == 'push' || inputs.target == 'pypi'
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist