Skip to content

Commit 2ebeef7

Browse files
committed
add a 'mirror' action that will mirror artifacts from online
1 parent 4e085a3 commit 2ebeef7

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/mirror.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
on:
2+
workflow_dispatch:
3+
inputs:
4+
url:
5+
description: "URL of the artifact to mirror."
6+
type: string
7+
required: true
8+
github_tag:
9+
description: "Tag to upload the artifact to."
10+
type: string
11+
required: true
12+
sha256_hash:
13+
description: "Hash of the downloaded artifact to validate."
14+
type: string
15+
required: true
16+
17+
env:
18+
XZ_OPT: "-T0"
19+
20+
name: Mirror
21+
22+
jobs:
23+
mirror_artifact:
24+
name: Mirror Artifact
25+
runs-on: ubuntu-latest
26+
permissions:
27+
contents: write
28+
29+
steps:
30+
- name: Download and Validate Artifact
31+
run: |
32+
mkdir downloads
33+
cd downloads
34+
35+
ARTIFACT_NAME=$(basename ${{ inputs.url }})
36+
37+
wget ${{ inputs.url }}
38+
echo "${{ inputs.sha256_hash }} $ARTIFACT_NAME" | sha256sum --check
39+
40+
- name: Upload Mirrored Artifact to Release
41+
uses: svenstaro/upload-release-action@v2
42+
with:
43+
file: "downloads/*"
44+
file_glob: true
45+
tag: ${{ inputs.github_tag }}
46+
overwrite: true

0 commit comments

Comments
 (0)