Workflow file for this run
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
on: | |
push: | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
workflow_dispatch: null | |
name: Create Release | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@main | |
- uses: nicknovitski/nix-develop@v1 | |
- name: Lint with flake8 | |
run: | | |
cd src | |
flake8 --version | |
flake8 | |
- name: Test with pytest | |
run: | | |
cd src/tests | |
pytest --version | |
pytest | |
build: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
pip install build | |
- name: Build | |
run: | | |
cd src | |
python -m build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: src/dist | |
release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
environment: release | |
needs: build | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Publish to PyPi | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/-publish@release/v1 |