-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (99 loc) · 3.05 KB
/
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
107
108
109
110
111
112
113
114
115
116
117
name: Build
on:
push:
branches:
- master
release:
types: [ created ]
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
build:
name: Build
runs-on: [ windows-latest ]
steps:
- name: Get latest CMake and ninja
uses: lukka/get-cmake@latest
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup VS environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Build and install debug
run: |
cmake --preset x64-Debug .
cmake --build _build/x64-Debug --parallel
cmake --install _build/x64-Debug
- name: Build and install release
run: |
cmake --preset x64-Release .
cmake --build _build/x64-Release --parallel
cmake --install _build/x64-Release
- name: Copy debug artifacts
run: |
mkdir _dist-debug
Copy-Item _install/x64-Debug/bin/* -Destination _dist-debug/ -Recurse
Copy-Item LICENSE -Destination _dist-debug/LICENSE
- name: Copy release artifacts
run: |
mkdir _dist-release
Copy-Item _install/x64-Release/bin/* -Destination _dist-release/ -Recurse
Copy-Item LICENSE -Destination _dist-release/LICENSE
- name: Archive debug
uses: actions/upload-artifact@v2
with:
name: MyMod-Debug
path: _dist-debug/*
- name: Archive release
uses: actions/upload-artifact@v2
with:
name: MyMod-Release
path: _dist-release/*
upload_release:
name: Upload release artifacts
needs: build
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- name: Download debug artifact
uses: actions/download-artifact@v2
with:
name: MyMod-Debug
path: MyMod-Debug
- name: Download release artifact
uses: actions/download-artifact@v2
with:
name: MyMod-Release
path: MyMod-Release
- name: Archive artifact files
run: |
cd MyMod-Debug
zip -r MyMod-Debug.zip *
cd ../MyMod-Release
zip -r MyMod-Release.zip *
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload debug assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: MyMod-Debug/MyMod-Debug.zip
asset_name: MyMod-Debug.zip
asset_content_type: application/zip
- name: Upload release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: MyMod-Release/MyMod-Release.zip
asset_name: MyMod-Release.zip
asset_content_type: application/zip