diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d68016f --- /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] + premissions: + 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