diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a83cc9d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +name: Release + +# Tag-triggered: build the bs-autobot wheel and publish to PyPI via Trusted +# Publishing (OIDC). First-time setup on pypi.org (maintainer action): +# Pending Publisher: repo BitterSecurity/AutoBot, workflow release.yml, +# environment pypi-release — then the publish job is authorized. +on: + push: + tags: ["v*"] + +permissions: + contents: write + +jobs: + publish-pypi: + name: Publish bs-autobot wheel to PyPI + runs-on: ubuntu-latest + environment: pypi-release + permissions: + id-token: write + contents: read + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v5 + - run: uv build --package autobot + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + github-release: + name: GitHub Release + needs: publish-pypi + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - name: Extract release notes from the tag annotation + run: | + git tag -l --format='%(contents)' "${GITHUB_REF#refs/tags/}" > RELEASE_NOTES.md + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + body_path: RELEASE_NOTES.md + draft: false