forked from AdrianCassar/xenia-canary
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (103 loc) · 3.27 KB
/
Windows_build.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
name: Windows build
on:
push:
paths-ignore:
- '.clang-format'
- '.drone.star'
- '.gitattributes'
- '.gitignore'
- '.gdbinit'
- '.github/*'
- '.github/*_TEMPLATE/**'
- '*.md'
- '*.yml'
- 'docs/**'
- 'src/**/*_posix.*'
- 'src/**/*_linux.*'
- 'src/**/*_gnulinux.*'
- 'src/**/*_x11.*'
- 'src/**/*_gtk.*'
- 'src/**/*_android.*'
- 'src/**/*_mac.*'
- 'LICENSE'
pull_request:
paths-ignore:
- '.clang-format'
- '.drone.star'
- '.gitattributes'
- '.gitignore'
- '.gdbinit'
- '.github/*'
- '.github/*_TEMPLATE/**'
- '*.md'
- '*.yml'
- 'docs/**'
- 'src/**/*_posix.*'
- 'src/**/*_linux.*'
- 'src/**/*_gnulinux.*'
- 'src/**/*_x11.*'
- 'src/**/*_gtk.*'
- 'src/**/*_android.*'
- 'src/**/*_mac.*'
- 'LICENSE'
workflow_dispatch:
jobs:
lint:
name: Lint
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: Check Clang-Format Version
run: clang-format --version
- name: Lint
run: .\xb lint --all
build-windows:
name: Build (Windows) # runner.os can't be used here
runs-on: windows-2019
needs: lint
env:
POWERSHELL_TELEMETRY_OPTOUT: 1
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
run: .\xb setup
- name: Build
run: .\xb build --config=Release --target=src\xenia-app
- name: Prepare artifacts
run: |
robocopy . build\bin\${{ runner.os }}\Release LICENSE /r:0 /w:0
robocopy build\bin\${{ runner.os }}\Release artifacts\xenia_canary_netplay xenia_canary_netplay.exe LICENSE /r:0 /w:0
If ($LastExitCode -le 7) { echo "LastExitCode = $LastExitCode";$LastExitCode = 0 }
- name: Upload xenia canary artifacts
uses: actions/upload-artifact@v4
with:
name: xenia_canary_netplay
path: artifacts\xenia_canary_netplay
if-no-files-found: error
- name: Create release
if: |
github.repository == 'xenia-canary/xenia-canary' &&
github.event.action != 'pull_request' &&
contains(github.ref, 'refs/heads/canary') &&
github.ref != 'refs/heads/canary_base'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$asset="xenia_canary_netplay.zip"
rm -recurse -force artifacts\xenia_canary_netplay\*.pdb # Ideally this would use xr, but I can't get it to work
7z a $asset .\artifacts\xenia_canary_netplay\*
If ($(Get-Item $asset).length -le 100000) {
Throw "Error: Archive $asset too small!"
}
$tag=$env:GITHUB_SHA.SubString(0,7)
$branch=$($env:GITHUB_REF -replace 'refs/heads/')
$title="${tag}_$branch"
gh release create $tag $asset --target $env:GITHUB_SHA -t $title
# Remove canary_ to prevent conflicts from tag
$tag=$($branch -replace 'canary_')
gh release delete $tag -y
git push --delete origin $tag
git tag -d $tag
gh release create $tag $asset --target $env:GITHUB_SHA -t $branch