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 0
73 lines (65 loc) · 1.96 KB
/
Copy pathmain.yml
File metadata and controls
73 lines (65 loc) · 1.96 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Release Build
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version_name:
description: 'a version name'
required: false
default: '0.0.0'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-2019
venv-init: venv\Scripts\activate
- os: ubuntu-18.04
venv-init: . venv/bin/activate
steps:
- name: checkout
uses: actions/checkout@v2
- name: load-cache
uses: actions/cache@v2
with:
path: ./venv
key: ${{ runner.os }}-${{ hashFiles('**/requirements.txt') }}
- name: build
env:
PROJECT_VERSION: ${{ github.event.inputs.version_name }}
run: |
python3 -m pip install wheel setuptools virtualenv
python3 -m virtualenv venv
${{ matrix.venv-init }}
pip install -r requirements.txt
pyinstaller build.spec
- 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-release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: dist/*;examples/*
draft: false
tags: true