-
Notifications
You must be signed in to change notification settings - Fork 13
59 lines (48 loc) · 1.26 KB
/
main.yml
File metadata and controls
59 lines (48 loc) · 1.26 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
51
52
53
54
55
56
57
58
59
name: main
on:
push:
tags:
- '*'
branches:
- master
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint:
uses: nickatnight/gha-workflows/.github/workflows/pre-commit.yml@main
tests:
uses: ./.github/workflows/test.yml
create-release:
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
needs: [lint, tests]
uses: nickatnight/gha-workflows/.github/workflows/create-release.yml@main
with:
branch: "master"
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
upload-release-to-pypi:
if: startsWith(github.ref, 'refs/tags/')
needs: [create-release]
name: upload release to PyPI
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
# Install a specific version of uv.
version: "0.7.18"
- name: Set up Python
run: uv python install
- name: Install the project
run: uv sync
- name: Build the package
run: uv build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1