forked from TeamSpen210/HammerAddons
-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (75 loc) · 2.69 KB
/
build-postcompiler.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
name: Build Postcompiler
on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true
jobs:
freeze:
strategy:
fail-fast: false
matrix:
include:
- artifact-name: 'win64'
python-version: '3.11'
arch: 'x64'
os: 'windows-latest'
# - artifact-name: 'linux64'
# python-version: '3.11'
# arch: 'x64'
# os: 'ubuntu-latest'
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}-${{ matrix.arch }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.arch }}
cache: 'pip'
cache-dependency-path: 'requirements.txt'
- name: Install srctools
run: |
python -m pip install -U setuptools pip wheel
python -m pip install -r requirements.txt
- name: Build assets
run: |
mkdir build
mkdir build/bin
mkdir build/bin/win64
mkdir build/hammer
robocopy hammer/scripts build/hammer/scripts /S /PURGE
robocopy hammer/materials/tools build/hammer/materials/tools /S /PURGE
python src/hammeraddons/build_fgd_assets.py -i patch_postcompiler.fgd -o build/hammer -a hammer
- name: Freeze application
run: python -m PyInstaller --distpath ../build/bin/win64 -y ../postcompiler.spec
working-directory: ./src/
- name: Zip hammeraddons_${{ matrix.artifact-name }}
uses: thedoctor0/zip-release@master
with:
type: 'zip'
directory: ./build/
filename: 'hammeraddons_${{ matrix.artifact-name }}.zip'
- name: Artifact upload (tag)
uses: actions/upload-artifact@v4
if: github.event_name == 'create'
with:
name: hammeraddons_${{ github.event.inputs.version }}_${{ matrix.artifact-name }}
path: ./build/hammeraddons_${{ matrix.artifact-name }}.zip
if-no-files-found: error
- name: Artifact upload (hash)
uses: actions/upload-artifact@v4
if: github.event_name != 'create'
with:
name: hammeraddons_${{ github.event.inputs.version }}_${{ matrix.artifact-name }}
path: ./build/hammeraddons_${{ matrix.artifact-name }}.zip
if-no-files-found: error
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.version }}
files: |
./build/hammeraddons_${{ matrix.artifact-name }}.zip
fail_on_unmatched_files: true