Skip to content

Commit 331f4b6

Browse files
committed
CI: setup release artifacts build job and upload with trusted publishing
1 parent 0444e63 commit 331f4b6

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# SPDX-FileCopyrightText: 2025 The meson-python developers
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
name: release
6+
on:
7+
push:
8+
tags:
9+
- '[0-9]+.[0-9]+.[0-9]+'
10+
pull_request:
11+
branches:
12+
- main
13+
- release-*
14+
15+
jobs:
16+
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.14'
24+
- run: python -m pip install build
25+
- run: python -m build
26+
- uses: actions/upload-artifact@v4
27+
with:
28+
path: dist/*
29+
30+
upload:
31+
needs: build
32+
runs-on: ubuntu-latest
33+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
34+
environment:
35+
name: pipy
36+
url: https://pypi.org/p/meson-python
37+
permissions:
38+
id-token: write
39+
steps:
40+
- uses: actions/download-artifact@v4
41+
with:
42+
merge-multiple: true
43+
path: dist
44+
- uses: pypa/gh-action-pypi-publish@release/v1
45+
with:
46+
print-hash: true

0 commit comments

Comments
 (0)