Skip to content

test upload

test upload #97

Workflow file for this run

name: Wheels
on:
push:
tags:
- "**"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
# Reminder
# - name: Extract Branch Name
# run: echo "BRANCH=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV
# https://dev.to/tomassirio/if-statements-on-github-actions-545d
jobs:
wheels:
name: ${{ matrix.py }} ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
# matrix:
# os: [ubuntu-latest, windows-latest, macos-13, macos-14]
# arch: [auto, aarch64]
# py: [cp39, cp310, cp311, cp312, cp313]
# exclude:
# - os: windows-latest
# arch: aarch64
# - os: macos-13
# arch: aarch64
# - os: macos-14
# arch: aarch64
matrix:
os: [ubuntu-latest]
arch: [auto]
py: [cp39]
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0 # needed by setuptools_scm
- if: ${{ matrix.arch == 'aarch64' }}
uses: docker/setup-qemu-action@v3
- uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.py }}-*
CIBW_ARCHS: ${{ matrix.arch }}
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.py }}-${{ matrix.os }}-${{ matrix.arch }}
path: ./wheelhouse/*.whl
sdist:
name: source package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0 # needed by setuptools_scm
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: pipx run build --sdist
- run: python -m pip install --upgrade pip setuptools
- run: python -m pip install -v $(echo dist/*)'[test]'
- run: python -m pytest
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
upload:
if: github.event_name == 'push' && contains(github.event.ref, '/tags/')
needs: [wheels, sdist]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/pyhepmc/
permissions:
id-token: write
attestations: write
steps:
- uses: actions/[email protected]
with:
pattern: "*"
merge-multiple: true
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1.8