forked from ryzom/ryzomcore
-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (109 loc) · 4.08 KB
/
package.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
name: Package
on:
push:
branches: [ "feature/gltf-tools" ]
tags:
- v*
env:
c_compiler: gcc
cpp_compiler: g++
build_type: Release
main_branch: gltf-tools
concurrency:
group: "package"
cancel-in-progress: false
jobs:
package:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
COMMIT_HASH=${{ github.sha }}
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "${{ env.main_branch }}" ] && VERSION=snapshot
echo VERSION=$VERSION
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "full_version=${VERSION}+sha.${COMMIT_HASH:0:8}" >> "$GITHUB_OUTPUT"
- name: Dependencies
run: >
sudo apt update;
sudo apt install --yes
autoconf
automake
bison
clang-15
freeglut3-dev
libavcodec-dev
libavdevice-dev
libavformat-dev
libcpptest-dev
libcurl4-openssl-dev
libfreetype6-dev
libgif-dev
libgsf-1-dev
libjpeg-dev
liblua5.2-dev
libluabind-dev
liblzma-dev
libmysqlclient-dev
libogg-dev
libopenal-dev
libpng-dev
libpostproc-dev
libsquish-dev
libssl-dev
libswscale-dev
libvorbis-dev
libxml2-dev
ninja-build
qtbase5-dev
qttools5-dev
qttools5-dev-tools
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-G "Ninja"
-DCMAKE_CXX_COMPILER=${{ env.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ env.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ env.build_type }}
-DCPACK_PACKAGE_VERSION="${{ steps.strings.outputs.full_version }}"
-DWITH_STATIC=ON
-DWITH_NEL_TESTS=ON
-DWITH_NEL_SAMPLES=ON
-DWITH_LUA51=OFF
-DWITH_LUA52=ON
-DWITH_RYZOM=ON
-DWITH_RYZOM_SERVER=ON
-DWITH_RYZOM_CLIENT=ON
-DWITH_RYZOM_TOOLS=ON
-DWITH_NEL_TOOLS=ON
-DWITH_NELNS=ON
-DWITH_NELNS_LOGIN_SYSTEM=ON
-DWITH_NELNS_SERVER=ON
-DWITH_QT5=ON
-DWITH_LIBGSF=ON
-S ${{ github.workspace }}
- name: Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ env.build_type }}
- name: Unit Tests
working-directory: ${{ steps.strings.outputs.build-output-dir }}
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest --build-config ${{ env.build_type }}
- name: Package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{env.build_type}} --target package
gh release create --prerelease "${{ steps.strings.outputs.version }}" ${{ steps.strings.outputs.build-output-dir }}/*.sh