-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (78 loc) · 2.79 KB
/
Copy pathpublish.yml
File metadata and controls
99 lines (78 loc) · 2.79 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Publish to PyPI
on:
workflow_dispatch:
permissions: {}
concurrency:
group: publish-pypi
cancel-in-progress: false
jobs:
publish:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: pypi
permissions:
contents: write
id-token: write
attestations: write
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.10'
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
version: "0.11.0"
- name: Install dependencies
run: uv sync --group dev --locked
- name: Determine release version
id: release_version
run: uv run python scripts/determine_version.py stable pypi
- name: Confirm final version
run: |
final_version="${{ steps.release_version.outputs.version }}"
echo "Final version to publish: $final_version"
- name: Get latest version from PyPI
id: pypi_version
run: |
pypi_version=$(uv run python scripts/version_utils.py get-pypi-latest pypi)
echo "version=$pypi_version" >> $GITHUB_OUTPUT
echo "PyPI version: $pypi_version"
- name: Check if version already exists
run: uv run python scripts/check_version.py "${{ steps.release_version.outputs.version }}" stable pypi
- name: Set version for later steps
id: version
run: echo "version=${{ steps.release_version.outputs.version }}" >> $GITHUB_OUTPUT
- name: Run tests
run: make test-ci
- name: Clean dist directory
run: rm -rf dist/*
- name: Build package
run: uv build
- name: Check build artifacts
run: |
echo "Built packages:"
ls -la dist/
- name: Generate build provenance attestation
uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0
with:
subject-path: dist/*
- name: Publish to PyPI
run: uv publish
- name: Create GitHub Release
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
with:
tag_name: v${{ steps.version.outputs.version }}
name: Release v${{ steps.version.outputs.version }}
draft: false
prerelease: false
body: |
Release v${{ steps.version.outputs.version }}
Published to PyPI: https://pypi.org/project/freeplay/${{ steps.version.outputs.version }}/
files: |
dist/*.whl
dist/*.tar.gz