diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index fed5ce4..b1b2120 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,9 +2,10 @@ name: GitHub Pages on: push: - tags: ["v*.*"] + tags: [ "v*.*" ] workflow_dispatch: + jobs: build: runs-on: ubuntu-22.04 diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 0000000..a6cb580 --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,29 @@ +name: Build and Publish to PyPI + +on: + workflow_call: + workflow_dispatch: + + +jobs: + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to PyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Python 3.9 + uses: actions/setup-python@v3 + with: + python-version: "3.9" + - name: Install pypa/build + run: >- + python -m pip install build --user + - name: Build a binary wheel and a source tarball + run: >- + python -m build --sdist --wheel --outdir dist/ . + - name: Publish a Python distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f3a67d6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: 🚀 Release + +on: + push: + tags: + - 'v*.*.*' + +permissions: + contents: write + +jobs: + build-n-publish: + uses: ./.github/workflows/pypi.yml + + create-release: + env: + GH_TOKEN: ${{ github.token }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: update latest tag + uses: richardsimko/update-tag@v1 + with: + tag_name: latest + + - name: Generate New Release + run: | + gh release create ${{ github.ref }}