Skip to content

Python-package

Python-package #23

Workflow file for this run

---
name: Python Build Package
on:
pull_request:
branches:
- main
push:
branches:
- main
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-22.04
container:
image: quay.io/pypa/manylinux2014_x86_64
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
env:
GOEXPERIMENT: cgocheck2
steps:
- name: Set up OS deps
shell: bash
run: |
yum -y update
yum -y install git gcc make wget
wget https://go.dev/dl/go1.21.6.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.21.6.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go version
- uses: actions/checkout@v4
- name: Run module tests
run: go test -race -v ./...
- name: Build the CLI
shell: bash
run: |
cd cmd/cli
export PKG_CONFIG_PATH=/opt/_internal/cpython-${{ matrix.python-version }}.*/lib/pkgconfig/
CGO_ENABLED=1 go build -o caddysnake-cli main.go
touch dummy.c
python -m pip install cibuildwheel
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/dist
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}