Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion .github/workflows/mswin-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: |
set -x
sudo apt-get update -q || :
sudo apt-get install --no-install-recommends -y ruby bundler
sudo apt-get install --no-install-recommends -y ruby bundler zip unzip

- name: Checkout ${{ github.repository }}
# A branch dispatched before it is merged has to index with its
Expand All @@ -68,6 +68,26 @@ jobs:
aws s3 cp "$zip.sha256" "s3://ftp.r-l.o/$dev/$name.sha256" --no-progress
done

- name: Upload ruby-head
# ruby-head-<platform>.zip is a stable URL for the newest dev
# build, which setup-ruby installs as `mswin`. The zip root has to
# match the file name, so the package is repacked under the new
# name rather than copied, and the overwritten object is purged.
run: |
set -ex
dev=pub/ruby/binaries/mswin64/dev
for zip in pkg/*.zip; do
pkg=$(basename "$zip" .zip)
head=ruby-head-$(echo "$pkg" | cut -d- -f5-)
rm -rf repack "$head.zip"
mkdir repack
unzip -q "$zip" -d repack
mv "repack/$pkg" "repack/$head"
(cd repack && zip -qrX "../$head.zip" "$head")
aws s3 cp "$head.zip" "s3://ftp.r-l.o/$dev/$head.zip" --no-progress --metadata signed=false
curl -sS -X PURGE -H "Fastly-Soft-Purge:1" "https://cache.ruby-lang.org/$dev/$head.zip"
done

- name: Prune old dev builds
# Keep the newest 30 dev builds of each platform. Listing goes
# through list-objects-v2 rather than `aws s3 ls`, whose
Expand Down
2 changes: 2 additions & 0 deletions tool/update_binaries_index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def scan_builds(bucket)
builds = []
bucket.objects(prefix: PREFIX).each do |obj|
next unless obj.key.end_with?('.zip')
# A repacked copy of the newest dev build under a stable URL, see mswin-snapshot.yml
next if obj.key.match?(%r{\A#{PREFIX}dev/ruby-head-#{PLATFORM}\.zip\z}o)
basename = File.basename(obj.key)
common = {
name: basename.delete_suffix('.zip'),
Expand Down