Skip to content

Commit 9c96dfa

Browse files
committed
Publish releases to Astral mirror
1 parent cc8d63b commit 9c96dfa

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Publish ty releases to a mirror
2+
#
3+
# Assumed to run as a subworkflow of .github/workflows/release.yml as a custom publish job
4+
name: publish-mirror
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
plan:
10+
required: true
11+
type: string
12+
13+
permissions: {}
14+
15+
jobs:
16+
publish-mirror:
17+
runs-on: ubuntu-latest
18+
environment:
19+
name: release
20+
env:
21+
VERSION: ${{ fromJson(inputs.plan).announcement_tag }}
22+
steps:
23+
- name: "Download GitHub Artifacts"
24+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
25+
with:
26+
pattern: artifacts-*
27+
path: artifacts
28+
merge-multiple: true
29+
- name: "Upload to R2"
30+
env:
31+
AWS_ACCESS_KEY_ID: ${{ secrets.MIRROR_R2_ACCESS_KEY_ID }}
32+
AWS_SECRET_ACCESS_KEY: ${{ secrets.MIRROR_R2_SECRET_ACCESS_KEY }}
33+
AWS_ENDPOINT_URL: https://${{ secrets.MIRROR_R2_CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com
34+
AWS_DEFAULT_REGION: auto
35+
R2_BUCKET: ${{ secrets.MIRROR_R2_BUCKET_NAME }}
36+
PROJECT: ty
37+
run: |
38+
aws s3 cp --recursive --output table --color on \
39+
--exclude '*' \
40+
--include '*.zip' --include '*.zip.sha256' \
41+
--include '*.tar.gz' --include '*.tar.gz.sha256' \
42+
--include sha256.sum --include '*.ps1' --include '*.sh' \
43+
--cache-control "public, max-age=31536000, immutable" \
44+
artifacts/ \
45+
"s3://${R2_BUCKET}/github/${PROJECT}/releases/download/${VERSION}/"

0 commit comments

Comments
 (0)