Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.

Commit 8b6d6e5

Browse files
Qv2ray-devQv2ray-dev
authored andcommitted
action: update release hash checker
1 parent 377c3d6 commit 8b6d6e5

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/hashfile.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Update release files hash
2+
3+
on:
4+
release:
5+
types: [edited]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- run: echo ::set-env name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
13+
shell: bash
14+
- run: echo ::set-env name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')
15+
shell: bash
16+
- name: Checking out sources
17+
uses: actions/checkout@master
18+
- name: Hash File
19+
shell: bash
20+
run: |
21+
wget -O release.info https://api.github.com/repos/Qv2ray/${REPOSITORY_NAME}/releases/tags/${VERSION}
22+
cat ./release.info | jq -r ".assets | .[] | .browser_download_url" > download.list
23+
cat ./release.info | jq -r ".assets | .[] | { uploader_id: .uploader.login, asset_name: .name }" > assets.info.json
24+
mkdir files
25+
cd files
26+
for x in $(cat ../download.list); do
27+
wget "$x";
28+
done;
29+
rm assets.info.json || true
30+
rm sha256.list || true
31+
sha256sum ./* > ../sha256.list
32+
- name: Upload metadata to release
33+
uses: svenstaro/upload-release-action@v1-release
34+
with:
35+
repo_token: ${{ secrets.GITHUB_TOKEN }}
36+
file: assets.info.json
37+
asset_name: assets.info.json
38+
tag: ${{ github.ref }}
39+
overwrite: true
40+
- name: Upload metadata to release
41+
uses: svenstaro/upload-release-action@v1-release
42+
with:
43+
repo_token: ${{ secrets.GITHUB_TOKEN }}
44+
file: sha256.list
45+
asset_name: sha256.list
46+
tag: ${{ github.ref }}
47+
overwrite: true

0 commit comments

Comments
 (0)