Skip to content

Merge pull request #132 from ymyzk/fix-upload-ci #326

Merge pull request #132 from ymyzk/fix-upload-ci

Merge pull request #132 from ymyzk/fix-upload-ci #326

Workflow file for this run

name: Packaging
on:
push:
release:
types: [published]
jobs:
build_sdist:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python-version: ['3.12']
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: python -m pip install --upgrade build
- name: Create packages
run: python -m build -s
- uses: actions/upload-artifact@v4
with:
name: wsgi_lineprof_dist_sdist
path: dist
build_wheel:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, windows-2022, macos-13, macos-14]
arch: [auto]
include:
- os: ubuntu-20.04
arch: aarch64
- os: windows-2022
arch: ARM64
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up QEMU
if: runner.os == 'Linux' && matrix.arch == 'aarch64'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Build wheels
uses: pypa/cibuildwheel@v2.19.2
env:
CIBW_ARCHS: ${{ matrix.arch }}
- uses: actions/upload-artifact@v4
with:
name: wsgi_lineprof_dist_wheel_${{ matrix.os }}_${{ matrix.arch }}
path: ./wheelhouse/*.whl
build:
needs:
- build_sdist
- build_wheel
runs-on: ubuntu-latest
steps:
- uses: actions/upload-artifact/merge@v4
with:
name: wsgi_lineprof_dist
pattern: wsgi_lineprof_dist_*
- uses: actions/download-artifact@v4
with:
name: wsgi_lineprof_dist
path: dist
- name: Show result
run: ls -l dist
upload:
needs:
- build
runs-on: ubuntu-latest
if: github.event_name == 'release'
environment: release
permissions:
contents: write # Required for uploading artifacts to GitHub release
id-token: write # Required for using pypa/gh-actions-pypi-publish
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: wsgi_lineprof_dist
path: dist
- name: Upload artifacts to GitHub release
working-directory: ./dist
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload "${{ github.event.release.tag_name }}" ./*
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1