From b5d79392ceb0e5ebc0319bb547ba95c94ad1556a Mon Sep 17 00:00:00 2001 From: Kazuya Takei Date: Mon, 19 Feb 2024 04:19:30 +0900 Subject: [PATCH] ci: Add release flow --- .github/workflows/release.yml | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 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..de19b0d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,54 @@ +name: 'Release new version' + +on: + push: + tags: + - 'v*.*.*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: eifinger/setup-rye@v1 + - name: Build package + id: build_package + run: | + rye build + - uses: actions/upload-artifact@v4 + with: + name: packages-${{ github.ref }} + path: dist/ + gh-release: + runs-on: ubuntu-latest + needs: [build] + permissions: + contents: write + steps: + - uses: actions/download-artifact@v4 + with: + name: packages-${{ github.ref }} + path: dist/ + - uses: ncipollo/release-action@v1 + with: + artifacts: 'dist/*' + body: 'See https://github.com/attakei/rst-multi-refs/blob/main/CHANGELOG.rst' + draft: false + name: Release ${{ github.ref }} + tag: ${{ github.ref }} + prerelease: false + pypi-publish: + runs-on: ubuntu-latest + needs: [build] + environment: + name: pypi + url: https://pypi.org/p/rst-multi-refs + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + - uses: actions/download-artifact@v4 + with: + name: packages-${{ github.ref }} + path: dist/ + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1