Skip to content

Commit

Permalink
Merge pull request #26 from gescheit/gescheit-patch-2
Browse files Browse the repository at this point in the history
Create publish.yml
  • Loading branch information
gescheit authored Jan 20, 2025
2 parents 3709089 + 2485269 commit 67ab424
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build and publish wheel to pypi

on:
release:
types: [created]

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Extract version
uses: kaisugi/[email protected]
id: extract-version
with:
text: ${{ github.event.ref }}
regex: ^refs/tags/v([0-9]+\.[0-9]+(\.[0-9]+)?)$

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install pypa/build
run: python3 -mpip install --user build

- name: Build a binary wheel and a source tarball
run: python3 -m build
env:
VERSION: "${{ github.event.release.tag_name }}"

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

publish-to-pypi:
name: Publish to pypi.org
needs: [ build ]
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/fastsnmp

permissions:
id-token: write

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
with:
verify-metadata: false

0 comments on commit 67ab424

Please sign in to comment.