-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (89 loc) · 2.98 KB
/
Copy pathdeploy.yml
File metadata and controls
104 lines (89 loc) · 2.98 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
100
101
102
103
name: Deploy
on:
release:
types: [created]
workflow_dispatch:
inputs:
version:
description: 'Version to deploy (e.g., 0.1.0)'
required: true
type: string
jobs:
deploy-pypi:
name: deploy-pypi
runs-on: ubuntu-latest
# Use 'pypi' environment per PyPI trusted publishing and Python Packaging Guide.
# Create it under Settings → Environments and register it in PyPI trusted publishers.
environment:
name: pypi
url: https://pypi.org/project/ccbt/
permissions:
contents: read
id-token: write # For trusted publishing
steps:
- uses: actions/checkout@v4
- name: Install UV
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install build dependencies
run: |
uv sync --dev
uv pip install build twine
- name: Build package
run: |
uv run python -m build
- name: Validate package
run: |
uv run twine check dist/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
print-hash: true
- name: Verify PyPI publication
run: |
echo "Waiting 10 seconds for PyPI to propagate..."
sleep 10
echo "Package should be available at: https://pypi.org/project/ccbt/"
create-release-assets:
name: create-release-assets
runs-on: ubuntu-latest
needs: deploy-pypi
permissions:
contents: write # Required to upload release assets
actions: read
steps:
- uses: actions/checkout@v4
- name: Download Windows executable
uses: actions/download-artifact@v4
with:
name: windows-executable
path: dist/
github-token: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Upload release assets
uses: softprops/action-gh-release@v1
with:
files: |
dist/*.whl
dist/*.tar.gz
dist/bitonic.exe
draft: false
prerelease: false
continue-on-error: true
- name: Post-release verification
run: |
echo "## ✅ Release Deployment Complete" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- PyPI package published" >> $GITHUB_STEP_SUMMARY
echo "- GitHub Release created with assets" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Next Steps:**" >> $GITHUB_STEP_SUMMARY
echo "1. Verify PyPI: https://pypi.org/project/ccbt/" >> $GITHUB_STEP_SUMMARY
echo "2. Verify Release: https://github.com/ccBittorrent/ccbt/releases" >> $GITHUB_STEP_SUMMARY
echo "3. Test installation: \`uv pip install ccbt\`" >> $GITHUB_STEP_SUMMARY