-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add a github workflow to build and publish linux wheels (#250)
- Loading branch information
1 parent
01493ef
commit 25f8d6e
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |