Skip to content

Commit

Permalink
Add GitHub action workflow for build/release
Browse files Browse the repository at this point in the history
  • Loading branch information
mborgerson committed Mar 28, 2024
1 parent a71a2fb commit d390c31
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build

on: [push, pull_request]

permissions:
contents: read

jobs:

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Build sdist
run: |
python -m pip install --user build
python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: source
path: dist/*.tar.gz

upload_pypi:
name: Upload wheels to PyPI
needs: [build_sdist]
environment:
name: pypi
url: https://pypi.org/p/pyqodeng
permissions:
id-token: write
runs-on: ubuntu-latest
# Upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit d390c31

Please sign in to comment.