-
Notifications
You must be signed in to change notification settings - Fork 9
46 lines (43 loc) · 1.28 KB
/
release.yaml
File metadata and controls
46 lines (43 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Release
on:
push:
tags:
- "*/v*"
jobs:
package_name:
name: Get package name
runs-on: ubuntu-latest
outputs:
package_name: ${{ steps.split.outputs.package_name }}
steps:
- name: Get repo name
# https://stackoverflow.com/questions/73402042/github-action-expressions-split-string
env:
TAG: ${{ github.ref_name }}
id: split
run: echo "package_name=${TAG%%/*}" >> $GITHUB_OUTPUT
release:
name: Release ${{ needs.package_name.outputs.package_name }}
runs-on: ubuntu-latest
needs: package_name
environment:
name: pypi
url: https://pypi.org/p/${{ needs.package_name.outputs.package_name }}
permissions:
id-token: write
if: ${{ github.repository }} == 'stapi-spec/pystapi'
defaults:
run:
working-directory: ${{ needs.package_name.outputs.package_name }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- name: Create virtual environment
run: uv venv
- name: Install build
run: uv pip install build
- name: Build
run: .venv/bin/python -m build
- uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ${{ needs.package_name.outputs.package_name}}/dist