99 - release/8.0
1010
1111env :
12- VERSION : " 8.0.0 "
12+ VERSION : " 8.0.1 "
1313
1414jobs :
1515 build-containers :
3939 version : 8
4040 - name : rockylinux
4141 version : 9
42-
42+
4343 container :
4444 image : ghcr.io/${{ github.repository }}/builder:${{ matrix.os.name }}${{ matrix.os.version }}
4545 credentials :
@@ -102,11 +102,11 @@ jobs:
102102 - distro : quay.io/centos/centos
103103 distro_version : 8
104104 platform : [amd64, arm64]
105- distro :
105+ distro :
106106 - rockylinux
107107 - almalinux
108108 - quay.io/centos/centos
109- distro_version :
109+ distro_version :
110110 - 8
111111 - 9
112112
@@ -129,7 +129,7 @@ jobs:
129129
130130 # Download systemctl replacement first as .py file
131131 curl -L https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl3.py -o /usr/bin/systemctl3.py
132-
132+
133133 # Handle Python interpreter path based on distribution
134134 if [ "${{ matrix.distro }}" = "quay.io/centos/centos" ] && [ "${{ matrix.distro_version }}" = "8" ]; then
135135 # CentOS 8 uses platform-python
@@ -138,10 +138,10 @@ jobs:
138138 # Other distributions use regular python3
139139 pythonpath="/usr/bin/python3"
140140 fi
141-
141+
142142 echo "Using Python interpreter: $pythonpath"
143143 sed -i -e "s|/usr/bin/python3|$pythonpath|" /usr/bin/systemctl3.py
144-
144+
145145 # Copy to final location after modification
146146 cp /usr/bin/systemctl3.py /usr/bin/systemctl
147147 chmod +x /usr/bin/systemctl
@@ -154,7 +154,7 @@ jobs:
154154 run : |
155155 sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
156156 sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
157-
157+
158158 - name : Install RPM dependencies
159159 run : |
160160 dnf install -y ./rpm/*.rpm || true
@@ -165,7 +165,7 @@ jobs:
165165 run : |
166166 for i in {1..5}; do redis-cli ping &>/dev/null && break || echo "Waiting for Redis... $i" && sleep 1; done
167167 redis-cli info server || { echo "Cannot get server info"; exit 1; }
168-
168+
169169 - name : Verify installed modules
170170 run : |
171171 modules=$(redis-cli module list)
@@ -234,13 +234,11 @@ jobs:
234234 exit 1
235235 fi
236236
237- upload-rpm :
238- name : Upload RPM to S3
237+ download-rpms :
238+ name : Download RPM Artifacts
239239 needs : test-rpm
240240 if : github.ref == 'refs/heads/release/8.0'
241241 runs-on : ubuntu-latest
242- permissions :
243- id-token : write
244242 strategy :
245243 fail-fast : false
246244 matrix :
@@ -254,7 +252,37 @@ jobs:
254252 - uses : actions/download-artifact@v4
255253 with :
256254 name : redis-${{ matrix.os.version }}-${{ matrix.platform }}-rpm
257- path : s3uploads
255+ path : rpms/${{ matrix.os.name }}${{ matrix.os.version }}/${{ matrix.platform }}
256+
257+ - name : Upload RPM directory for further processing
258+ uses : actions/upload-artifact@v4
259+ with :
260+ name : redis-${{ matrix.os.name }}${{ matrix.os.version }}-${{ matrix.platform }}-for-repo
261+ path : rpms
262+ retention-days : 1
263+
264+ upload-rpm :
265+ name : Upload RPM to S3
266+ needs : download-rpms
267+ if : github.ref == 'refs/heads/release/8.0'
268+ runs-on : ubuntu-latest
269+ permissions :
270+ id-token : write
271+ strategy :
272+ fail-fast : false
273+ matrix :
274+ os :
275+ - name : rockylinux
276+ version : 8
277+ - name : rockylinux
278+ version : 9
279+ steps :
280+ - name : Download all RPM artifacts
281+ uses : actions/download-artifact@v4
282+ with :
283+ pattern : redis-${{ matrix.os.name }}${{ matrix.os.version }}-*-for-repo
284+ path : combined-rpms
285+ merge-multiple : true
258286
259287 - name : Configure AWS Credentials
260288 uses : aws-actions/configure-aws-credentials@v4
@@ -284,12 +312,14 @@ jobs:
284312 KEYGRIP=$(gpg --list-keys --with-keygrip | grep Keygrip | head -n1 | awk '{print $3}')
285313 echo "KEYGRIP=$KEYGRIP" >> $GITHUB_OUTPUT
286314
287- - name : Sign RPM packages
315+ - name : Install required tools
288316 run : |
289317 # Install required tools
290318 sudo apt-get update
291319 sudo apt-get install -y rpm createrepo-c s3cmd
292320
321+ - name : Sign RPM packages
322+ run : |
293323 # Export and import GPG key for RPM
294324 gpg --export -a "${{ steps.gpg_email.outputs.GPG_EMAIL }}" > rpm-gpg-key.asc
295325 sudo rpm --import rpm-gpg-key.asc
@@ -298,20 +328,49 @@ jobs:
298328 mkdir -p ~/.gnupg
299329 echo "allow-preset-passphrase" > ~/.gnupg/gpg-agent.conf
300330 gpg-connect-agent reloadagent /bye
301-
331+
302332 # Preset passphrase for non-interactive signing
303333 /usr/lib/gnupg/gpg-preset-passphrase -P "${{ secrets.GPG_PASSWORD }}" -c "${{ steps.gpg_keygrip.outputs.KEYGRIP }}"
304-
305- # Sign all RPM packages
306- cd s3uploads
307- find . -name "*.rpm" -exec rpmsign --addsign --key-id "${{ steps.gpg_id.outputs.GPG_ID }}" {} \;
308-
309- # Create repository metadata with signatures
334+
335+ # Sign new RPM packages before copying them to the final repository
336+ echo "Signing new RPM packages..."
337+ find combined-rpms/rpms/${{ matrix.os.name }}${{ matrix.os.version }} -name "*.rpm" -exec rpmsign --addsign --key-id "${{ steps.gpg_id.outputs.GPG_ID }}" {} \;
338+
339+ echo "Signed packages:"
340+ find combined-rpms/rpms/${{ matrix.os.name }}${{ matrix.os.version }} -name "*.rpm" | sort
341+
342+ - name : Prepare repository structure
343+ env :
344+ RPM_S3_BUCKET : ${{ secrets.RPM_S3_BUCKET }}
345+ RPM_S3_REGION : ${{ secrets.RPM_S3_REGION }}
346+ run : |
347+ # Create directory for the final repository
348+ mkdir -p s3uploads/${{ matrix.os.name }}${{ matrix.os.version }}
349+
350+ # First download existing packages from S3 to ensure we include them in the repo metadata
351+ echo "Downloading existing packages from S3..."
352+ s3cmd sync --region=${{ env.RPM_S3_REGION }} s3://${{ env.RPM_S3_BUCKET }}/rpm/${{ matrix.os.name }}${{ matrix.os.version }}/ s3uploads/${{ matrix.os.name }}${{ matrix.os.version }}/
353+
354+ # Copy all signed RPMs from both architectures to the repository directory
355+ echo "Adding newly signed packages..."
356+ cp -r combined-rpms/rpms/${{ matrix.os.name }}${{ matrix.os.version }}/* s3uploads/${{ matrix.os.name }}${{ matrix.os.version }}/
357+
358+ # List all files to verify
359+ echo "All packages in repository:"
360+ find s3uploads -type f -name "*.rpm" | sort
361+
362+ # Create repository metadata with signatures for this OS version
363+ echo "Generating repository metadata..."
364+ cd s3uploads/${{ matrix.os.name }}${{ matrix.os.version }}
310365 createrepo_c .
311366
312367 - name : Update packages and publish to private repo
313368 env :
314369 RPM_S3_BUCKET : ${{ secrets.RPM_S3_BUCKET }}
315370 RPM_S3_REGION : ${{ secrets.RPM_S3_REGION }}
316371 run : |
317- s3cmd sync --acl-public --region=${{ env.RPM_S3_REGION }} s3uploads/* s3://${{ env.RPM_S3_BUCKET }}/rpm/${{ matrix.os.name }}${{ matrix.os.version }}/
372+ # Use --no-delete-removed to ensure we don't delete any existing packages
373+ echo "Uploading repository to S3..."
374+ s3cmd sync --acl-public --no-delete-removed --region=${{ env.RPM_S3_REGION }} s3uploads/${{ matrix.os.name }}${{ matrix.os.version }}/* s3://${{ env.RPM_S3_BUCKET }}/rpm/${{ matrix.os.name }}${{ matrix.os.version }}/
375+
376+ echo "Repository update complete for ${{ matrix.os.name }}${{ matrix.os.version }}"
0 commit comments