This repository was archived by the owner on Jun 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (51 loc) · 1.59 KB
/
Copy pathtest.yml
File metadata and controls
56 lines (51 loc) · 1.59 KB
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
name: Test
on:
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
version_name:
description: 'a version name'
required: false
default: 'test-version'
jobs:
build:
runs-on: windows-2019
steps:
- name: Git Checkout
uses: actions/checkout@v2
- name: Load Cache
uses: actions/cache@v2
with:
path: ./venv
key: ${{ hashFiles('**/requirements.txt') }}
- name: Build
env:
PROJECT_VERSION: ${{ github.event.inputs.version_name }}
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))
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())