Skip to content

Commit ade1c91

Browse files
committed
Add build automation and multi-distribution support
Introduce Packit configuration and build infrastructure for automated builds across Fedora, CentOS Stream, and EPEL distributions. - Add .packit.yaml for automated release monitoring and COPR builds - Add Makefile with flexible DIST parameter (defaults to rawhide) - Add GitHub Actions workflow for CI validation - Add README with setup and build instructions - Add check-upstream.sh for PyPI version monitoring Assisted-by: Claude Sonnet 4.5
1 parent 49973de commit ade1c91

File tree

5 files changed

+485
-0
lines changed

5 files changed

+485
-0
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Validate RPM Spec
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
validate:
12+
runs-on: ubuntu-latest
13+
container:
14+
image: fedora:43
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Install dependencies
21+
run: |
22+
dnf install -y rpm-build rpmdevtools rpmlint spectool \
23+
python3-devel python3-setuptools python3-wheel \
24+
gcc gcc-c++ python3-Cython
25+
26+
- name: Validate spec file
27+
run: |
28+
rpmlint python-debugpy.spec || true
29+
30+
- name: Download sources
31+
run: |
32+
spectool -g python-debugpy.spec
33+
34+
- name: Build SRPM
35+
run: |
36+
rpmbuild -bs python-debugpy.spec \
37+
--define "_sourcedir $PWD" \
38+
--define "_srcrpmdir $PWD"
39+
40+
- name: Upload SRPM
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: srpm
44+
path: "*.src.rpm"
45+
retention-days: 30
46+
47+
build-fedora:
48+
needs: validate
49+
runs-on: ubuntu-latest
50+
strategy:
51+
matrix:
52+
fedora: [43, 44, rawhide]
53+
container:
54+
image: fedora:${{ matrix.fedora }}
55+
56+
steps:
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
59+
60+
- name: Install dependencies
61+
run: |
62+
dnf install -y rpm-build rpmdevtools spectool \
63+
python3-devel python3-setuptools python3-wheel \
64+
gcc gcc-c++ python3-Cython
65+
66+
- name: Download sources
67+
run: |
68+
spectool -g python-debugpy.spec
69+
70+
- name: Build RPM
71+
run: |
72+
rpmbuild -ba python-debugpy.spec \
73+
--define "_sourcedir $PWD" \
74+
--define "_rpmdir $PWD/RPMS" \
75+
--define "_srcrpmdir $PWD/SRPMS" \
76+
--define "_builddir $PWD/BUILD" \
77+
--define "_buildrootdir $PWD/BUILDROOT"
78+
79+
- name: Upload RPMs
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: rpms-fedora-${{ matrix.fedora }}
83+
path: |
84+
RPMS/**/*.rpm
85+
SRPMS/*.src.rpm
86+
retention-days: 30

.packit.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
specfile_path: python-debugpy.spec
2+
3+
# Upstream project configuration
4+
upstream_project_url: https://github.com/microsoft/debugpy
5+
upstream_package_name: debugpy
6+
downstream_package_name: python-debugpy
7+
8+
# Monitor upstream releases
9+
issue_repository: https://github.com/microsoft/debugpy
10+
11+
jobs:
12+
# Build in COPR on new upstream releases
13+
- job: copr_build
14+
trigger: release
15+
targets:
16+
- fedora-43
17+
- fedora-44
18+
- fedora-rawhide
19+
- centos-stream-9
20+
- centos-stream-10
21+
- epel-9
22+
- epel-10
23+
project: python-debugpy
24+
25+
# Propose updates to Fedora on new releases
26+
- job: propose_downstream
27+
trigger: release
28+
dist_git_branches:
29+
- fedora-43
30+
- fedora-44
31+
- fedora-rawhide
32+
33+
# Automatically build in Koji when PR is merged
34+
- job: koji_build
35+
trigger: commit
36+
dist_git_branches:
37+
- fedora-43
38+
- fedora-44
39+
- fedora-rawhide
40+
41+
# Create Bodhi updates for stable releases
42+
- job: bodhi_update
43+
trigger: commit
44+
dist_git_branches:
45+
- fedora-43
46+
- fedora-44
47+
48+
# Files to sync from upstream (optional)
49+
files_to_sync:
50+
- src: .packit.yaml
51+
dest: .packit.yaml
52+
- src: python-debugpy.spec
53+
dest: python-debugpy.spec
54+
55+
# Merge changes automatically if tests pass (optional)
56+
merge_pr_in_ci: false

Makefile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
.PHONY: help srpm rpm mock clean spectool
2+
3+
SPEC_FILE = python-debugpy.spec
4+
PACKAGE_NAME = python-debugpy
5+
DIST ?= fedora-rawhide-x86_64
6+
7+
help:
8+
@echo "Available targets:"
9+
@echo " spectool - Download source files"
10+
@echo " srpm - Build source RPM"
11+
@echo " rpm - Build binary RPM (requires sources)"
12+
@echo " mock - Build using mock (DIST=<target>, default: fedora-rawhide-x86_64)"
13+
@echo " clean - Clean build artifacts"
14+
@echo ""
15+
@echo "Mock build examples:"
16+
@echo " make mock DIST=fedora-43-x86_64"
17+
@echo " make mock DIST=fedora-44-x86_64"
18+
@echo " make mock DIST=fedora-rawhide-x86_64"
19+
@echo " make mock DIST=centos-stream-9-x86_64"
20+
@echo " make mock DIST=centos-stream-10-x86_64"
21+
@echo " make mock DIST=epel-9-x86_64"
22+
@echo " make mock DIST=epel-10-x86_64"
23+
24+
spectool:
25+
spectool -g -R $(SPEC_FILE)
26+
27+
srpm: spectool
28+
rpmbuild -bs $(SPEC_FILE) \
29+
--define "_sourcedir $(PWD)" \
30+
--define "_srcrpmdir $(PWD)"
31+
32+
rpm: spectool
33+
rpmbuild -ba $(SPEC_FILE) \
34+
--define "_sourcedir $(PWD)" \
35+
--define "_rpmdir $(PWD)" \
36+
--define "_srcrpmdir $(PWD)" \
37+
--define "_builddir $(PWD)/BUILD" \
38+
--define "_buildrootdir $(PWD)/BUILDROOT"
39+
40+
mock: srpm
41+
mock -r $(DIST) --rebuild *.src.rpm
42+
43+
clean:
44+
rm -rf BUILD BUILDROOT RPMS SRPMS
45+
rm -f *.rpm *.tar.gz *.log
46+
rm -rf results_*

0 commit comments

Comments
 (0)