-
Notifications
You must be signed in to change notification settings - Fork 1
154 lines (136 loc) · 4.67 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
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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Build binaries
on:
push:
branches: [ "main" ]
paths:
- CHANGES.md
- .github/workflows/**
permissions:
write-all
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: |
./setup.ps1 CI_BUILD
- name: package
run: |
mkdir Release
cp -r -force ./EditorContent Release/EditorContent
cp -r -force ./CSharp Release/CSharp
cp -r -force ./Tools Release/Tools
cp -r -force ./ProjectGenerator.exe Release
cp -r -force ./Docs Release/Docs
- name: upload artifact
uses: actions/upload-artifact@v3
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
path: Release
name: Klemmgine-Windows-${{ github.run_number }}.zip
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
run: git submodule update --init --recursive
- name: install dependencies
run: |
sudo apt update
sudo apt autoremove --purge snapd
sudo apt-get install libsdl2-dev
sudo apt-get install libglew-dev
sudo apt-get install libopenal-dev
cd Dependencies
git clone https://github.com/Klemmbaustein/KlemmBuild.git --recurse-submodules
cd KlemmBuild
sudo make install
- name: build
run: |
chmod +x setup.sh
./setup.sh CI_BUILD
- name: install doxygen
run: |
wget https://www.doxygen.nl/files/doxygen-1.10.0.linux.bin.tar.gz
tar -xf doxygen-1.10.0.linux.bin.tar.gz
cd doxygen-1.10.0
sudo make
- name: make-release
run: |
doxygen
mkdir Release
cp -rf ./EditorContent Release/EditorContent
cp -rf ./CSharp Release/CSharp
cp -rf ./Tools Release/Tools
cp -rf ./ProjectGenerator Release
cp -rf ./Docs Release/Docs
- name: upload artifact
uses: actions/upload-artifact@v3
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
path: Release
name: Klemmgine-Linux-${{ github.run_number }}
Release:
runs-on: ubuntu-latest
needs: [ build-windows, build-linux ]
steps:
- name: Retrieve Release Artifacts
uses: actions/download-artifact@v2
with:
path: Release
- name: compress artifacts
run: |
cd ${{ github.workspace }}/Release/Klemmgine-Windows-${{ github.run_number }}.zip
zip -r ${{ github.workspace }}/klemmgine-win.zip ./*
export LINUX_ARTIFACT_NAME=${{ github.workspace }}/Release/Klemmgine-Linux-${{ github.run_number }}
cd $LINUX_ARTIFACT_NAME
chmod +x ProjectGenerator
chmod +x Tools/ProjectGenerator/LinuxFiles/Editor.sh
cd ..
tar -czf ${{ github.workspace }}/klemmgine-linux.tar.gz Klemmgine-Linux-${{ github.run_number }}
- name: list-directory
run: ls -R
- name: Create release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: "Build #${{ github.run_number }}"
tag_name: Build-${{ github.run_number }}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: upload linux artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: klemmgine-linux.tar.gz
asset_name: Klemmgine-Linux-${{ github.run_number }}.tar.gz
asset_content_type: application/zip
- name: upload windows artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: klemmgine-win.zip
asset_name: Klemmgine-Windows-${{ github.run_number }}.zip
asset_content_type: application/zip