Skip to content

Commit

Permalink
add workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
paquiteau committed Mar 29, 2024
1 parent 47d0fda commit a030186
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/tags-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release on PyPi

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
build-n-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
environment: pypi-release
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get history and tags for SCM versioning to work
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install pypa/build
run: |
python -m pip install build
python -m pip install .
- name: Build a binary wheel and a source tarball
run: |
python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

gh-release:
name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 100
- name: Create Relase
run: gh release create "$GITHUB_REF_NAME" --generate-notes -d
32 changes: 32 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# this file is *not* meant to cover or endorse the use of GitHub Actions, but rather to
# help test this project

name: Test

on: [push, pull_request]

jobs:
test:
strategy:
matrix:
python: ['3.10']
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[test,dev]
- name: Linter
run: |
black --check src tests
ruff .
- name: Test
run: |
pytest

0 comments on commit a030186

Please sign in to comment.