Skip to content

Workflow file for this run

name: Build and Publish
on:
workflow_dispatch:
release:
types:
- published
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
- name: Get version from setup.py
run: echo "PACKAGE_VERSION=$(python setup.py --version)" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: gh-actions/create-release@v1
with:
draft: false
prerelease: false
title: "Release ${{ env.PACKAGE_VERSION }}"
body: "Description of the release"
commitish: ${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Release Asset
uses: gh-actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./wheelhouse/
asset_name: *.whl

Check failure on line 68 in .github/workflows/build_wheels.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build_wheels.yml

Invalid workflow file

You have an error in your yaml syntax on line 68
asset_content_type: application/zip
token: ${{ secrets.GITHUB_TOKEN }}