From 247667a9dcbce425755b387a1054414fbd728e3e Mon Sep 17 00:00:00 2001 From: truthless-dev Date: Mon, 2 Jun 2025 16:15:42 -0700 Subject: [PATCH] build(gh-workflow): add release workflow --- .github/workflows/cd-release.yaml | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/cd-release.yaml diff --git a/.github/workflows/cd-release.yaml b/.github/workflows/cd-release.yaml new file mode 100644 index 0000000..81dc32d --- /dev/null +++ b/.github/workflows/cd-release.yaml @@ -0,0 +1,40 @@ +name: Release + +on: + push + tags: + - 'v*' + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version-file: '.python-version' + - name: Install dependencies + run: | + pip install poetry + poetry install + - name: Build dist + run: | + poetry build + - uses: actions/upload-artifact@v3 + with: + path: ./dist + + pypi-publish: + name: Publish to PyPI + needs: ['build'] + environment: 'release' + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v3 + - name: Publish + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages_dir: artifact/