This repository was archived by the owner on Dec 1, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
181 lines (148 loc) · 6.23 KB
/
build-ruby-simple.yml
File metadata and controls
181 lines (148 loc) · 6.23 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: Build Ruby RPM (Simple)
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Docker image
run: |
echo "Building Ruby 3.0.7 RPM for x86_64..."
docker build -t ruby-builder .
- name: Verify Docker Build Success
run: |
if ! docker inspect ruby-builder > /dev/null 2>&1; then
echo "❌ Docker build failed"
exit 1
fi
echo "✅ Docker build successful"
- name: Extract RPMs
run: |
mkdir -p output
# Get current user ID to fix permissions
USER_ID=$(id -u)
GROUP_ID=$(id -g)
# Run container and extract files with proper permissions
docker run --rm \
--user root \
-v $(pwd)/output:/output \
ruby-builder bash -c "
echo 'Container contents:'
ls -la /home/builder/
echo ''
echo 'RPM build output:'
ls -la /home/builder/output/ 2>/dev/null || echo 'No output directory found'
echo ''
# Copy only x86_64 and noarch RPMs from output directory
if [ -d '/home/builder/output' ] && [ \$(find /home/builder/output -name '*.rpm' | wc -l) -gt 0 ]; then
echo 'Copying x86_64 and noarch RPMs from output directory...'
find /home/builder/output -name '*x86_64.rpm' -exec cp {} /output/ \; 2>/dev/null || true
find /home/builder/output -name '*noarch.rpm' -exec cp {} /output/ \; 2>/dev/null || true
echo 'Copied x86_64 and noarch RPMs from output directory'
fi
# Also copy from traditional RPM build locations as backup (x86_64 and noarch only)
if [ -d '/home/builder/rpmbuild/RPMS' ]; then
echo 'Copying x86_64 and noarch RPMs from rpmbuild RPMS...'
find /home/builder/rpmbuild/RPMS -name '*x86_64.rpm' -exec cp {} /output/ \; 2>/dev/null || true
find /home/builder/rpmbuild/RPMS -name '*noarch.rpm' -exec cp {} /output/ \; 2>/dev/null || true
fi
if [ -d '/home/builder/rpmbuild/SRPMS' ]; then
echo 'Copying source RPMs...'
find /home/builder/rpmbuild/SRPMS -name '*.rpm' -exec cp {} /output/ \; 2>/dev/null || true
fi
# Copy spec files if they exist
if [ -f '/home/builder/rpmbuild/SPECS/ruby.spec' ]; then
cp /home/builder/rpmbuild/SPECS/ruby.spec /output/ruby-modified.spec 2>/dev/null || true
echo 'Copied modified spec'
fi
if [ -f '/home/builder/rpmbuild/SPECS/ruby.spec.bak' ]; then
cp /home/builder/rpmbuild/SPECS/ruby.spec.bak /output/ruby-original.spec 2>/dev/null || true
echo 'Copied original spec'
fi
# Fix ownership of copied files
chown -R $USER_ID:$GROUP_ID /output/ 2>/dev/null || true
echo ''
echo 'Final output contents:'
ls -la /output/
"
- name: List output
run: |
echo "Generated files:"
ls -la output/
if [ $(find output -name '*.rpm' | wc -l) -gt 0 ]; then
echo ""
echo "RPM details:"
for rpm in output/*.rpm; do
if [ -f "$rpm" ]; then
echo "=== $(basename $rpm) ==="
rpm -qp --info "$rpm" 2>/dev/null || echo "Could not read RPM info for $rpm"
echo ""
fi
done
else
echo "No RPM files found in output directory"
fi
- name: Extract Complete ruby3-0-7 Structure
run: |
mkdir -p ruby3-0-7-complete
# Get current user ID to fix permissions
USER_ID=$(id -u)
GROUP_ID=$(id -g)
# Extract the complete ruby3-0-7 directory structure from container
docker run --rm \
--user root \
-v $(pwd)/ruby3-0-7-complete:/ruby3-0-7-complete \
ruby-builder bash -c "
echo 'Extracting complete ruby3-0-7 structure...'
# Copy the complete ruby3-0-7 directory structure
if [ -d '/home/builder/ruby3-0-7' ]; then
cp -r /home/builder/ruby3-0-7 /ruby3-0-7-complete/
echo 'Copied complete ruby3-0-7 structure'
fi
# Fix ownership of copied files
chown -R $USER_ID:$GROUP_ID /ruby3-0-7-complete/ 2>/dev/null || true
echo 'Complete ruby3-0-7 structure:'
find /ruby3-0-7-complete -type f | sort
"
- name: Verify Complete Repository Structure
run: |
echo "Complete ruby3-0-7 structure:"
find ruby3-0-7-complete -type f | sort
echo ""
echo "Repository metadata verification:"
if [ -f "ruby3-0-7-complete/ruby3-0-7/rpm-repo/x86_64/repodata/repomd.xml" ]; then
echo "✅ Repository metadata found"
ls -la ruby3-0-7-complete/ruby3-0-7/rpm-repo/x86_64/repodata/
else
echo "❌ Repository metadata missing"
fi
echo ""
echo "Client setup files verification:"
if [ -f "ruby3-0-7-complete/ruby3-0-7/client-setup/ruby-build.repo" ]; then
echo "✅ Repository config found"
cat ruby3-0-7-complete/ruby3-0-7/client-setup/ruby-build.repo
fi
if [ -f "ruby3-0-7-complete/ruby3-0-7/client-setup/install.sh" ]; then
echo "✅ Install script found"
ls -la ruby3-0-7-complete/ruby3-0-7/client-setup/install.sh
fi
echo ""
echo "RPM packages in repository:"
find ruby3-0-7-complete -name "*.rpm" | wc -l
find ruby3-0-7-complete -name "*.rpm"
- name: Upload Complete ruby3-0-7 Repository
uses: actions/upload-artifact@v4
with:
name: ruby3-0-7-complete-x86_64
path: ruby3-0-7-complete/ruby3-0-7/
retention-days: 10
if: always()
- name: Upload Individual RPMs
uses: actions/upload-artifact@v4
with:
name: ruby-3.0.7-x86_64-rpms
path: output/
retention-days: 7
if: always()