Python-package #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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 | |
run: | | |
yum -y update | |
yum -y install go git gcc make | |
curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer | bash | |
source /github/home/.gvm/scripts/gvm | |
gvm install 1.21.6 | |
gvm use 1.21.6 | |
- uses: actions/checkout@v4 | |
- name: Run module tests | |
run: go test -race -v ./... | |
- name: Build the CLI | |
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 }} |