Skip to content

Commit

Permalink
ci: add a github workflow to build and publish linux wheels (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
florianvazelle authored Jan 31, 2024
1 parent 01493ef commit 25f8d6e
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Publish Python distribution to PyPI

on: push

jobs:
build:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install cibuildwheel
run: python3 -m pip install cibuildwheel==2.16.4

- name: Build wheels
run: python -m cibuildwheel --output-dir dist/

- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/*.whl

publish-to-pypi:
needs: [build]
runs-on: ubuntu-latest

# Only publish to PyPI on tag pushes
if: startsWith(github.ref, 'refs/tags/')

environment:
name: pypi
url: https://pypi.org/p/yara-python
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 25f8d6e

Please sign in to comment.