From 9aa90048818db7a30adc7a107c0c58236ebff89c Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Wed, 14 Aug 2024 09:29:07 +0800 Subject: [PATCH] chore(ci): setup automated release workflow (#168) --- .github/workflows/release.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e60c21e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: Release + +on: + push: + tags: + - "*" + +jobs: + build-package: + name: Build & inspect our package. + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: hynek/build-and-inspect-python-package@v2 + + release-pypi: + name: Publish released package to pypi.org + permissions: + id-token: write + environment: release + runs-on: ubuntu-latest + needs: build-package + + steps: + - name: Download packages built by build-and-inspect-python-package + uses: actions/download-artifact@v4 + with: + name: Packages + path: dist + + - name: Upload package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1