Skip to content

Commit

Permalink
ci: Add github action (#15)
Browse files Browse the repository at this point in the history
Fixes #13

Add a github action to publish a new version by pushing a tag
  • Loading branch information
jnumainville authored May 29, 2024
1 parent 3543bf0 commit 516caf7
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
wheel
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build

on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
tags: [ 'v*' ]

jobs:
build:
runs-on: ubuntu-22.04
permissions:
id-token: write
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: '.github/requirements.txt'

- name: Install Python dependencies
run: pip install -r .github/requirements.txt

- name: Build wheel
run: python -m build

- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
if-no-files-found: error

- uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')

0 comments on commit 516caf7

Please sign in to comment.