-
-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (70 loc) · 2.27 KB
/
manual.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
name: Build
on:
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3'
- name: Set up Python and create Virtual Environment
run: |
python -m pip install --upgrade pip
python -m venv env
.\env\Scripts\Activate.ps1
shell: powershell
- name: Enable long paths
run: |
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f
- name: Cache Python dependencies
uses: actions/cache@v2
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run build script
run: python build.py
- name: Extract version
id: get_version
run: |
echo ::set-output name=VERSION::$(python -c "from main import scriptVersion; print(scriptVersion)")
- name: Print version
id: print_version
run: |
python -c "from main import scriptVersion; print(scriptVersion)"
- name: Install 7z
run: |
choco install -y 7zip
- name: Archive files
run: |
7z a -mx=9 TAS_${{ steps.get_version.outputs.VERSION }}.7z ./dist
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.TAS }}
with:
tag_name: TAS_${{ steps.get_version.outputs.VERSION }}
release_name: TAS_${{ steps.get_version.outputs.VERSION }}
draft: true
- name: Upload Release Asset
id: upload_release_asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TAS }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./TAS_${{ steps.get_version.outputs.VERSION }}.7z
asset_name: TAS_${{ steps.get_version.outputs.VERSION }}.7z
asset_content_type: application/x-7z-compressed