-
Notifications
You must be signed in to change notification settings - Fork 572
50 lines (41 loc) · 1.13 KB
/
publish.yml
File metadata and controls
50 lines (41 loc) · 1.13 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
47
48
49
50
name: Release
on:
workflow_dispatch:
push:
branches: [ master ]
permissions:
contents: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install uv
run: make install-uv
- name: Semantic Release Version
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: uv run semantic-release version
- name: Check if dist directory exists
id: check_dist
run: |
if [ -d "dist" ]; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
- name: Publish to PyPI
if: steps.check_dist.outputs.exists == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
- name: Publish GitHub Release
if: steps.check_dist.outputs.exists == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: uv run semantic-release publish