diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..52bd79ecd --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,46 @@ +# SPDX-FileCopyrightText: 2025 The meson-python developers +# +# SPDX-License-Identifier: MIT + +name: release +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + pull_request: + branches: + - main + - release-* + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.14' + - run: python -m pip install build + - run: python -m build + - uses: actions/upload-artifact@v4 + with: + path: dist/* + + upload: + needs: build + runs-on: ubuntu-latest + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + environment: + name: pipy + url: https://pypi.org/p/meson-python + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + merge-multiple: true + path: dist + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + print-hash: true