-
Notifications
You must be signed in to change notification settings - Fork 7
48 lines (46 loc) · 1.64 KB
/
hashfile.yml
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
name: Update release files hash
on:
release:
types: [edited]
jobs:
build:
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- run: echo ::set-env name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
shell: bash
- run: echo ::set-env name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')
shell: bash
- name: Checking out sources
uses: actions/checkout@master
- name: Hash File
shell: bash
run: |
wget -O release.info https://api.github.com/repos/Qv2ray/${REPOSITORY_NAME}/releases/tags/${VERSION}
cat ./release.info | jq -r ".assets | .[] | .browser_download_url" > download.list
cat ./release.info | jq -r ".assets | .[] | { uploader_id: .uploader.login, asset_name: .name }" > assets.info.json
mkdir files
cd files
for x in $(cat ../download.list); do
wget "$x";
done;
rm assets.info.json || true
rm sha256.list || true
sha256sum ./* > ../sha256.list
- name: Upload metadata to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: assets.info.json
asset_name: assets.info.json
tag: ${{ github.ref }}
overwrite: true
- name: Upload metadata to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: sha256.list
asset_name: sha256.list
tag: ${{ github.ref }}
overwrite: true