-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (41 loc) · 1.24 KB
/
release_pypi.yaml
File metadata and controls
43 lines (41 loc) · 1.24 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
name: Create New Release (PyPI)
on:
workflow_dispatch:
jobs:
build_and_publish:
runs-on: ubuntu-latest
environment:
name: pypi
permissions:
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://github-actions:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
git fetch --tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get latest tag
id: get_latest_tag
run: |
LATEST_TAG=$(git tag | tail -n 1)
echo "::set-output name=latest_tag::$LATEST_TAG"
- name: Checkout code to latest tag
uses: actions/checkout@v5
with:
ref: ${{ steps.get_latest_tag.outputs.latest_tag }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install uv command
run: pip install uv
- name: Build and publish package
run: |
uv build
uv publish