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

Commit

Permalink
action: update release hash checker
Browse files Browse the repository at this point in the history
  • Loading branch information
Qv2ray-dev authored and Qv2ray-dev committed Apr 25, 2020
1 parent d5e95fe commit f00f396
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/hashfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Update release files hash

on:
release:
types: [edited]

jobs:
build:
runs-on: ubuntu-latest

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

0 comments on commit f00f396

Please sign in to comment.