This repository has been archived by the owner on Apr 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (52 loc) · 1.66 KB
/
main.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
name: Release Build
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Load Cache
uses: actions/cache@v2
with:
path: ./venv
key: ${{ hashFiles('**/requirements.txt') }}
- name: Build
run: |
tzutil /s "China Standard Time"
python -m pip install wheel setuptools virtualenv
python -m virtualenv venv
venv\Scripts\activate
pip install -r requirements.txt
pyinstaller build.spec
copy config.exam.yml dist\config.yml
- name: Print Hashes
shell: "python3 {0}"
run: |
import os
import hashlib
directory = 'dist'
def hash(fileToBeHashed, hashobj):
with open(fileToBeHashed, 'rb') as f:
hashobj.update(f.read())
return hashobj.hexdigest()
def show_hash(f, hashobj, indent=' '):
print(hashobj.name + ': ' + hash(f, hashobj) + '\n')
for f in os.listdir(directory):
sf = os.path.join(directory, f)
if os.path.isfile(sf):
print('Hashes for ' + sf)
show_hash(sf, hashlib.md5())
show_hash(sf, hashlib.sha1())
show_hash(sf, hashlib.sha256())
- name: Upload To Github Release
uses: xresloader/upload-to-github-release@98857380fc282f8075a62c6af230fe92bd93aff8
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
file: dist/*
draft: false
tags: true