-
Notifications
You must be signed in to change notification settings - Fork 3
47 lines (46 loc) · 1.67 KB
/
python-build.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
name: Python Build Package - Linux
on:
push:
tags: [ 'v*.*.*' ]
jobs:
build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
env:
GOEXPERIMENT: cgocheck2
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: false
- name: Install Xcaddy
run: go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
- name: Set up Python ${{ matrix.python-version }}
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update -yyqq
sudo apt-get install -yyqq software-properties-common
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get install -yyqq python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv
sudo mv /usr/lib/x86_64-linux-gnu/pkgconfig/python-${{ matrix.python-version }}-embed.pc /usr/lib/x86_64-linux-gnu/pkgconfig/python3-embed.pc
- name: Run module tests
run: go test -race -v ./...
- name: Build the CLI
run: |
cd cmd/cli
CGO_ENABLED=1 go build -o caddysnake-cli main.go
touch dummy.c
python -m pip install cibuildwheel==2.22.0
export CIBW_BUILD=cp$(echo ${{ matrix.python-version }} | tr -d .)-manylinux_x86_64
echo $CIBW_BUILD
CIBW_BUILD_VERBOSITY=1 python -m cibuildwheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: cmd/cli/wheelhouse
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}