-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (36 loc) · 1.03 KB
/
release.yaml
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
name: Release
on:
push:
branches:
- main
permissions:
contents: write
jobs:
pypi-publish:
name: PyPI Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: eifinger/setup-rye@v2
with:
enable-cache: true
- run: rye build --clean
- run: rye publish --skip-existing --token ${{ secrets.SALTSTACK_AGE_PYPI_TOKEN }} --yes
tag:
name: Create Git tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
git config --global user.name 'Github workflow'
git config --global user.email '[email protected]'
VERSION=$(grep -oP '^version = "\K(\d+\.\d+\.\d+)' pyproject.toml)
if git rev-parse --verify $VERSION >/dev/null 2>&1
then
echo "Tag $VERSION already exists"
exit
fi
git tag $VERSION -a -m "Automatically created"
git push origin $VERSION
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}