Skip to content

changed ci

changed ci #4

name: Build and Deploy Packages

Check failure on line 1 in .github/workflows/build-and-deploy.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build-and-deploy.yml

Invalid workflow file

(Line: 36, Col: 14): Unexpected symbol: 'python-version//'. Located at position 8 within expression: matrix.python-version//./
on:
push:
tags:
- 'v[0-9]*'
- feature/ci_test
workflow_dispatch:
jobs:
build-linux:
name: Build wheels on manylinux
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install build dependencies
run: |
python -m pip install --upgrade pip setuptools wheel build
- name: Build sdist (source distribution)
run: |
python -m build --sdist
- name: Build wheel inside manylinux container
run: |
docker run --rm \
-v ${{ github.workspace }}:/io \
quay.io/pypa/manylinux_2_28_x86_64 \
bash -c "cd /io && /opt/python/cp${{ matrix.python-version//./}}-cp${{ matrix.python-version//./}}/bin/python -m build --wheel"
- name: List build artifacts
run: ls -lh dist/
- name: Upload wheels as artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.python-version }}
path: dist/
# build-windows:
# name: Build Windows packages
# runs-on: windows-2019
# strategy:
# fail-fast: false
# matrix:
# python-version: ["3.11", "3.12", "3.13"]
# architecture: [x64, x86]
# steps:
# - uses: actions/checkout@v4
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python-version }}
# architecture: ${{ matrix.architecture }}
# - name: Set up MSVC
# uses: bus1/cabuild/action/msdevshell@v1
# with:
# architecture: ${{ matrix.architecture }}
# - name: Generate meson files
# run: |
# python scripts/generate_meson.py ./src/dbzero/ core
# python scripts/generate_meson_tests.py tests/
# - name: Configure git
# run: |
# git config --global user.email "ci@example.com"
# git config --global user.name "CI Builder"
# Remove-Item .gitignore -ErrorAction SilentlyContinue
# git add . && git commit -m "Update meson files for build"
# - name: Install build dependencies
# run: |
# pip install build cibuildwheel
# - name: Build wheels (Windows)
# run: python -m cibuildwheel --output-dir wheelhouse
# env:
# CIBW_BUILD: cp${{ matrix.python-version }}-*
# CIBW_ARCHS_WINDOWS: ${{ matrix.architecture }}
# - name: Upload Windows wheels
# uses: actions/upload-artifact@v4
# with:
# name: wheels-windows-${{ matrix.python-version }}-${{ matrix.architecture }}
# path: wheelhouse/*.whl
build-sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Generate meson files
run: |
python3 scripts/generate_meson.py ./src/dbzero/ core
python3 scripts/generate_meson_tests.py tests/
- name: Configure git
run: |
git config --global user.email "ci@example.com"
git config --global user.name "CI Builder"
rm .gitignore
git add . && git commit -m "Update meson files for build"
- name: Install build dependencies
run: |
pip install build meson
- name: Build source distribution
run: python -m build --sdist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
deploy-to-pypi:
name: Deploy to PyPI (Manual)
runs-on: ubuntu-latest
needs: [build-linux, build-sdist]
if: github.event_name == 'workflow_dispatch'
environment: pypi-deployment
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./dist/
- name: Flatten artifact structure
run: |
mkdir -p ./upload/
find ./dist/ -name "*.whl" -exec cp {} ./upload/ \;
find ./dist/ -name "*.tar.gz" -exec cp {} ./upload/ \;
ls -la ./upload/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: ${{ vars.REPO_URL }}
username: ${{ vars.USER }}
password: ${{ secrets.PASSWORD }}
packages-dir: ./upload/
verbose: true