diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7d3c74f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: Release + +on: + push: + tags: + - 'v[0-9]+\.[0-9]+\.[0-9]+' + +jobs: + pypi-publish: + name: upload release to PyPI + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Build dist + run: | + sudo apt-get install -y python3 python3-venv python3-pip + python3 -m venv .venv + source .venv/bin/activate + python3 -m pip install build + python3 -m build + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7321c7d..9f13c7c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ on: - develop jobs: - bats-test: + test: runs-on: ubuntu-latest steps: diff --git a/publish b/publish deleted file mode 100755 index 3ac3d7d..0000000 --- a/publish +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/bash - -version=$(grep -Po '(?<=version = ")[^"]*' pyproject.toml) -if git rev-parse -q --verify $version >/dev/null; then - echo "Version already exists. Aborting." - exit 1 -fi - -python3 -m build -python3 -m twine upload --repository pypi dist/* - -git tag $version -git push --tags