-
Notifications
You must be signed in to change notification settings - Fork 17
146 lines (122 loc) · 4.79 KB
/
pragma-windows-ci.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Build Windows
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
concurrency:
group: environment-win-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
build:
name: Build - ${{ matrix.config.os }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- os: windows-latest
name: "Windows x64 MSVC"
artifact: "Windows-MSVC.tar.xz"
build_type: "RelWithDebInfo"
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
cc: "cl"
cxx: "cl"
archiver: "7z a"
generators: "Visual Studio 17 2022"
build_dir: 'build'
steps:
- name: Setup Pragma
uses: Silverlan/pragma/github_actions/setup@master
# We need the latest Windows SDK
- uses: GuillaumeFalourd/[email protected]
with:
sdk-version: 22621
- name: Build Pragma
uses: Silverlan/pragma/github_actions/build@master
id: build-pragma
with:
build-args: "--with-pfm --with-all-pfm-modules --with-vr --with-lua-debugger=0 --cmake-arg=\"-DCMAKE_SYSTEM_VERSION=10.0.22621.0\" --vcvars \"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat\""
- name: Create Release Archive
shell: bash
run: |
curDir="$PWD"
# Add info file
cd "${{ steps.build-pragma.outputs.install-dir }}"
echo -e "ref: $GITHUB_REF \ncommit: $GITHUB_SHA\nbuild: $(date +"%Y-%m-%dT%H:%M:%SZ")" \
> ./git_info.txt
# Delete .git folders
find . -name ".git*" -exec rm -R {} \; 2>/dev/null || true
# Enable experimental updates
cd cfg
echo "pfm_enable_experimental_updates \"1\"" >> client.cfg
cd "$curDir"
7z a pragma-win64.zip "${{ steps.build-pragma.outputs.install-dir }}/**"
- name: Generate nightly tag description
shell: bash
run: |
curDate=$(date -u '+%Y-%m-%d %H:%M:%S %Z')
printf "This is an auto-generated pre-release, built from the latest version of the source code.\nIt includes all files necessary to run Pragma, as well as the latest version of the Pragma Filmmaker, however functionality and stability are **not** guaranteed.\n\nLatest release date: $curDate" > tag_text.txt
- name: Update nightly tag description
uses: softprops/[email protected]
with:
body_path: tag_text.txt
tag_name: nightly
prerelease: true
- name: Update nightly release
uses: pyTooling/Actions/releaser/composite@main
with:
tag: nightly
token: ${{ secrets.GITHUB_TOKEN }}
files: "pragma-win64.zip"
# Publish debug PDB files
- name: Create PDB Archive
shell: bash
run: |
curDir="$PWD"
mkdir pdb
source_directory="${{ steps.build-pragma.outputs.build-dir }}"
target_directory="$curDir/pdb"
move_file() {
local source_file="$1"
local destination_dir
local base_name
local destination_file
local counter=1
base_name=$(basename "$source_file")
destination_dir="$target_directory"
destination_file="$destination_dir/$base_name"
# Check if the destination file already exists
while [[ -e "$destination_file" ]]; do
# Append a number to the destination file name
destination_file="${destination_dir}/${base_name}_${counter}"
counter=$((counter + 1))
done
mv "$source_file" "$destination_file"
echo "Moved: $source_file -> $destination_file"
}
find "$source_directory" -type f -name "*.pdb" -print0 | while IFS= read -r -d '' file; do
move_file "$file"
done
cd "$curDir"
# 7z expects a standard windows path
winPath=$(echo "$curDir" | sed -e 's/^\///' -e 's/\//\\/g' -e 's/^./\0:/')
7z a debug_pdb.zip "$winPath/pdb/**"
- name: Update PDB release
uses: pyTooling/Actions/releaser/composite@main
with:
tag: nightly
token: ${{ secrets.GITHUB_TOKEN }}
files: "debug_pdb.zip"
#
- name: Run Tests
uses: Silverlan/pragma/github_actions/run_tests@master
timeout-minutes: 10
with:
install-dir: "${{ steps.build-pragma.outputs.install-dir }}"
- name: Handle Error
uses: Silverlan/common_actions/action_handle_error@main
if: failure()