-
Notifications
You must be signed in to change notification settings - Fork 389
68 lines (57 loc) · 1.85 KB
/
build_checksums.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Compute checksums
on:
push:
branches: [ checksums ]
workflow_dispatch:
inputs:
tag:
description: 'The tag name for which to run it (eg: v22.1.0). If not specified, defaults to the latest release'
required: false
jobs:
build:
name: Compute and Post Checksums
runs-on: ubuntu-latest
permissions:
# Needed permission to upload the release asset
contents: write
steps:
- name: Download binaries
shell: bash
run: |
set -x
TAG_NAME=${{ github.event.inputs.tag }}
if [ -z "$TAG_NAME" ]; then
url=https://api.github.com/repos/NREL/EnergyPlus/releases/latest
else
url=https://api.github.com/repos/NREL/EnergyPlus/releases/tags/$TAG_NAME
fi;
echo "Querying url=$url"
release_info=$(curl -sL $url)
# Get the tag name, and use jq -e to throw if can't find
TAG_NAME=$(echo $release_info | jq -r -e '.tag_name')
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
echo $release_info | jq -r '.assets[].browser_download_url | select(. | contains("EnergyPlus-"))' > download_lists.txt
echo "Found the following assets"
cat download_lists.txt
echo "Downloading all via aria"
aria2c --input-file download_lists.txt -j $(nproc)
echo "Files in current directory:"
ls
- name: Compute md5 sums
shell: bash
run: |
md5sum EnergyPlus-* > md5sums.txt
cat md5sums.txt
- name: Compute sha256 sums
shell: bash
run: |
sha256sum EnergyPlus-* > sha256sums.txt
cat sha256sums.txt
- name: Upload Sums to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '*.txt'
tag: ${{ env.TAG_NAME }}
overwrite: true
file_glob: true