-
Notifications
You must be signed in to change notification settings - Fork 15
164 lines (132 loc) · 5.45 KB
/
windows.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#
# Windows build action for ts-patches.
#
# Authors: CCHyper, OmniBlade
#
name: Windows
on:
push:
branches: [ master ]
jobs:
create_release:
runs-on: ubuntu-latest
steps:
- name: Delete Previous Release
uses: dev-drprasad/[email protected]
with:
delete_release: true
tag_name: latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
name: Build
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
type: [ TSCLIENT, MOD_DTA, MOD_TI, MOD_TO, MOD_RUBICON, MOD_FD ]
#type: [ SINGLEPLAYER, TIBSUN, TSCLIENT, MOD_DTA, MOD_TI, MOD_TO, MOD_RUBICON, MOD_FD, MOD_TM ]
steps:
- name: Clone Repository
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Clone CnCNet Repository
uses: actions/checkout@v3
with:
fetch-depth: 1
repository: CnCNet/ts-patches-private
path: 'cncnet'
ssh-key: ${{ secrets.CNCNET_CI_SSH_PRIVATEKEY }}
- name: Get Branch Name
id: branch-name
uses: tj-actions/[email protected]
- name: Set Variables
id: gitinfo
run: |
echo "Branch name: '${{ steps.branch-name.outputs.current_branch }}'"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
echo "::set-output name=date::$(git show -s --date=format:'%Y-%m-%d' --format=%cd HEAD)"
- name: MSVC Dev Cmd
uses: ilammy/[email protected]
with:
arch: x86
- name: Download WinBuilds
uses: suisei-cn/actions-download-file@v1
with:
url: "https://downloads.cncnet.org/WinBuilds32ForGitHubCI.zip"
- name: Install WinBuilds
run: |
7z x WinBuilds32ForGitHubCI.zip -owin-builds-patch-32
Get-ChildItem
Get-ChildItem -Path 'win-builds-patch-32'
- name: Add WinBuilds To PATH
run: |
echo "$env:GITHUB_WORKSPACE\win-builds-patch-32" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "$env:GITHUB_WORKSPACE\win-builds-patch-32\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Build Binaries
run: |
Get-ChildItem
New-Item -Path 'build\release' -ItemType Directory
gmake clean
gmake -j8 ${{ matrix.type }}=1
Move-Item -Path 'game.exe' -Destination 'build\release\game.exe'
# New-Item -Path 'build\debug' -ItemType Directory
# gmake clean
# gmake -j8 ${{ matrix.type }}=1 WWDEBUG=1
# Move-Item -Path 'game.exe' -Destination 'build\debug\game.exe'
New-Item -Path 'build\vinifera' -ItemType Directory
gmake clean
gmake -j8 ${{ matrix.type }}=1 VINIFERA=1
Move-Item -Path 'game.exe' -Destination 'build\vinifera\game.exe'
# Only build the CnCNet binaries for TSCLIENT
if ("${{ matrix.type }}" -eq "TSCLIENT") {
New-Item -Path 'build\cncnet' -ItemType Directory
gmake clean
gmake -j8 ${{ matrix.type }}=1 CNCNET=1
Move-Item -Path 'game.exe' -Destination 'build\cncnet\game.exe'
Get-ChildItem -Path 'build\cncnet'
}
Get-ChildItem -Path 'build\release'
# Get-ChildItem -Path 'build\debug'
Get-ChildItem -Path 'build\vinifera'
- name: Copy Binaries
run: |
New-Item -Path 'artifact\release' -ItemType Directory
# New-Item -Path 'artifact\debug' -ItemType Directory
New-Item -Path 'artifact\vinifera' -ItemType Directory
Move-Item -Path 'build\release\game.exe' -Destination 'artifact\release\game.exe'
# Move-Item -Path 'build\debug\game.exe' -Destination 'artifact\debug\game.exe'
Move-Item -Path 'build\vinifera\game.exe' -Destination 'artifact\vinifera\game.exe'
# Only pack the CnCNet binaries for TSCLIENT
if ("${{ matrix.type }}" -eq "TSCLIENT") {
New-Item -Path 'artifact\cncnet' -ItemType Directory
Move-Item -Path 'build\cncnet\game.exe' -Destination 'artifact\cncnet\game.dat'
Get-ChildItem -Path 'artifact\cncnet'
}
Get-ChildItem -Path 'artifact\release'
# Get-ChildItem -Path 'artifact\debug'
Get-ChildItem -Path 'artifact\vinifera'
Get-ChildItem
Get-ChildItem -Path 'build'
Get-ChildItem -Path 'artifact'
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: ts-patches-${{ matrix.type }}-${{ steps.branch-name.outputs.current_branch }}-${{ steps.gitinfo.outputs.sha_short }}-${{ steps.gitinfo.outputs.date }}
path: artifact
- name: Create Archive For Release
run: |
Get-ChildItem -Path 'build'
7z a ts-patches-${{ matrix.type }}-${{ steps.branch-name.outputs.current_branch }}-${{ steps.gitinfo.outputs.sha_short }}.zip .\artifact\*
- name: Upload New Release
if: ${{ github.event_name != 'pull_request' }}
uses: softprops/action-gh-release@v1
with:
name: Latest
tag_name: latest
body: Latest ts-patches binaries.
files: |
ts-patches-${{ matrix.type }}-${{ steps.branch-name.outputs.current_branch }}-${{ steps.gitinfo.outputs.sha_short }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}