-
Notifications
You must be signed in to change notification settings - Fork 149
97 lines (84 loc) · 2.82 KB
/
release.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Release
on:
push:
tags: [ '*' ]
jobs:
package:
name: Package
runs-on: ubuntu-latest
defaults:
run:
working-directory: '..'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Python dependencies
run: |
sudo apt-get install libcurl4-openssl-dev
pip install packaging pycurl
- name: Prepare for package
run: |
cd GotoX
rm -rf .git*
rm -rf .travis*
python launcher/updatecas.py -u -d --all
python launcher/buildipdb.py -u -d --17mon --apnic
python launcher/builddomains.py -u -d --felix
cd python/site-packages
7z a -tzip -mx=9 -mfb=258 -mtc=off helpers-win32.egg winsystray
rm -rf winsystray
- name: Pack source
run: |
7z a -mx=9 -mfb=258 -mtc=off GotoX-${{ github.ref_name }}-py3-any.zip ./GotoX/*
- name: Pack Windows
run: |
pack() {
cp -r GotoX GotoX-${3};
cd GotoX-${3};
python pack_portable.py ${1}-${3};
if [ $? != 0 ]; then return 1; fi;
rm -rf pack_portable.*;
7z a -mx=9 -m0=BCJ2 -m1=LZMA2:mf=bt3:fb=273:lc=2:lp=1:pb=1 -m2=LZMA2:fb=273 -m3=LZMA2:fb=273 -m4=LZMA2:fb=273 -mb0s0:1 -mb0s1:2 -mb0s2:3 -mb0s3:4 GotoX-${{ github.ref_name }}-${2}-${3}.7z *;
mv *.7z ..;
cd ..;
}
pack 3.11.4 cp311 win_amd64
- name: Prepare for release 1
shell: python
run: |
import os
import hashlib
from glob import glob
mf = open('md5.sum', 'w')
sf = open('sha256.sum', 'w')
bf = open('body.md', 'w')
bf.write('| filename | md5 | sha256 |\n')
bf.write('| -------- | :-: | :----: |\n')
for artifact in (glob('*.zip') + glob('*.7z')):
md5sum = hashlib.md5()
sha256sum = hashlib.sha256()
with open(artifact, 'rb') as f:
b = f.read(8192)
while b:
md5sum.update(b)
sha256sum.update(b)
b = f.read(8192)
filename = os.path.basename(artifact)
md5sum = md5sum.hexdigest().upper()
sha256sum = sha256sum.hexdigest().upper()
mf.write(f'{md5sum} {filename}\n')
sf.write(f'{sha256sum} {filename}\n')
bf.write(f'| {filename} | {md5sum} | {sha256sum} |\n')
- name: Prepare for release 2
run: |
mv body.md *.sum *.zip *.7z GotoX
- name: Create Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
bodyFile: 'body.md'
artifacts: '*.sum,*.zip,*.7z'