update README #249
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
name: Python | |
on: | |
push: | |
branches: [ develop ] | |
tags: [ '*' ] | |
pull_request: | |
branches: [ develop ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check Nix flake Nixpkgs inputs | |
uses: DeterminateSystems/flake-checker-action@main | |
- uses: cachix/install-nix-action@v30 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- uses: cachix/cachix-action@v15 | |
with: | |
name: mycache | |
- run: nix flake check | |
- run: nix run .#test | |
publish: | |
runs-on: ubuntu-latest | |
needs: test | |
environment: release | |
permissions: | |
id-token: write | |
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get tags | |
run: git fetch --tags origin | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Bump version | |
run: sed 's/version = "0.0.0"/version = "${{ github.ref_name }}"/' -i pyproject.toml && git diff | |
- name: Install uv | |
run: python -m pip install uv | |
- name: Build dist | |
run: uv build | |
- name: Publish | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: dist/ |