-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (61 loc) · 2.18 KB
/
mirror-sync.yml
File metadata and controls
68 lines (61 loc) · 2.18 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
name: Mirror Sync
on:
# Run daily to catch new upstream versions
schedule:
- cron: '0 4 * * *' # Every day at 4 AM UTC
# Manual trigger
workflow_dispatch:
inputs:
runtime:
description: 'Runtime to sync (node, python, ruby, or all)'
required: true
default: 'all'
type: choice
options:
- all
- node
- python
- ruby
jobs:
sync:
name: Sync ${{ matrix.runtime }}
runs-on: ubuntu-latest
timeout-minutes: 180 # 3 hours max for sync
strategy:
fail-fast: false
matrix:
runtime: ${{ (github.event_name == 'workflow_dispatch' && inputs.runtime != 'all') && fromJson(format('["{0}"]', inputs.runtime)) || fromJson('["node", "python", "ruby"]') }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Build mirror tool
run: |
cd scripts/mirror-binaries
go build -o mirror-binaries .
- name: Sync new binaries to R2
env:
R2_ENDPOINT: https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com
R2_BUCKET: ${{ secrets.CLOUDFLARE_R2_BUILDS_BUCKET }}
R2_ACCESS_KEY: ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }}
R2_SECRET_KEY: ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }}
run: |
./scripts/mirror-binaries/mirror-binaries \
--runtime=${{ matrix.runtime }} \
--r2-endpoint="$R2_ENDPOINT" \
--r2-bucket="$R2_BUCKET" \
--r2-access-key="$R2_ACCESS_KEY" \
--r2-secret-key="$R2_SECRET_KEY" \
--sync-only \
--workers=10
- name: Generate summary
if: always()
run: |
echo "## Sync Results for ${{ matrix.runtime }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Synced new binaries from upstream that were not already in R2." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "To generate updated manifests, run the 'Generate Manifests from R2' workflow." >> $GITHUB_STEP_SUMMARY