This repository has been archived by the owner on Apr 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
109 lines (109 loc) · 4.11 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
name: CI/CD
on: [push, pull_request]
jobs:
linux:
name: 🐧
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
branch:
- master
platform:
- linux
- mingw
lib-type:
- static
architecture:
- 64
build-type:
- rel
include:
- { platform: web, lib-type: static, architecture: wasm, build-type: rel, branch: websockets-implementation }
- { platform: android, lib-type: shared, architecture: all, build-type: rel, branch: master }
env:
HOST: ${{ github.job }}
PLATFORM: ${{ matrix.platform }}
BUILD_TYPE: ${{ matrix.build-type }}
LIB_TYPE: ${{ matrix.lib-type }}
ARCH: ${{ matrix.architecture }}
DBE_TAG: master
URHO3D_SAMPLES: 0
URHO3D_TOOLS: 0
URHO3D_EXTRAS: 0
URHO3D_PLAYER: 0
steps:
- name: Checkout
uses: actions/checkout@v2
with: { fetch-depth: 0 }
- name: Free up space
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android
sudo apt-get clean
df -h
if: matrix.platform == 'android' || matrix.build-type == 'dbg'
- name: Clone engine
run: |
git clone --depth 1 --branch ${{ matrix.branch }} https://github.com/urho3d/Urho3D.git
- name: Cache
uses: actions/cache@v2
with:
path: |
build/cache/.ccache
build/cache/.gradle/caches
build/cache/.gradle/wrapper
key: |
${{ matrix.platform }}-${{ matrix.lib-type }}-${{ matrix.architecture }}-${{ matrix.build-type }}-${{ env.DBE_TAG }}-${{ steps.source_checksum.outputs.hexdigest }}
restore-keys: |
${{ matrix.platform }}-${{ matrix.lib-type }}-${{ matrix.architecture }}-${{ matrix.build-type }}-${{ env.DBE_TAG }}
${{ matrix.platform }}-${{ matrix.lib-type }}-${{ matrix.architecture }}-${{ matrix.build-type }}
- name: DBE
run: |
cd Urho3D
rake update_dot_files && script/dockerized.sh ${PLATFORM/-*} env
- name: cmake
run: |
cd Urho3D
script/dockerized.sh ${PLATFORM/-*} rake cmake
if: matrix.platform != 'android' && matrix.platform != 'linux-clang-format'
- name: Build
run: |
cd Urho3D
script/dockerized.sh ${PLATFORM/-*} rake build
if: matrix.platform != 'linux-clang-format'
- name: Scaffolding - install
run: |
cd Urho3D
script/dockerized.sh ${PLATFORM/-*} rake install[~/stage]
if [[ $PLATFORM == android ]]; then touch build/cache/.gradle/mark; fi
if: matrix.platform != 'linux-clang-tidy' && matrix.platform != 'linux-clang-format'
- name: Scaffolding - build
run: |
URHO3D_HOME=/home/urho3d/stage/usr/local script/dockerized.sh ${PLATFORM/-*}
if: matrix.platform != 'linux-clang-tidy' && matrix.platform != 'linux-clang-format'
- name: Scaffolding - cleanup
run: |
if [[ $PLATFORM == android ]]; then
rm -rf build/cache/.m2
find build/cache/.gradle -newer build/cache/.gradle/mark -type d |xargs rm -rf
else
rm -rf build/cache/{stage,projects}
fi
if: matrix.platform != 'linux-clang-tidy' && matrix.platform != 'linux-clang-format'
- name: Upload
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.platform }}-${{ matrix.lib-type }}-${{ matrix.architecture }}-${{ matrix.build-type }}
path: |
build/ci/bin
- name: Tweak web build artifacts
if: matrix.platform == 'web'
run: mv build/ci/bin/ProjectTemplate.html build/ci/bin/index.html
- name: Upload to Itch.io
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
PROJECT_NAME: miegamicis/sandbox
run: |
curl -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
unzip butler.zip
./butler push build/ci/bin $PROJECT_NAME:${{ matrix.platform }} --userversion ${GITHUB_RUN_NUMBER}