-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (107 loc) · 4.25 KB
/
release.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
name: release
on:
push:
tags:
- '*'
jobs:
job:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
include:
- name: Windows (x64)
os: windows-latest
triplet: x64-windows
arch: x64
experimental: false
winarch: win64
- name: Windows (x86)
os: windows-latest
triplet: x86-windows
experimental: false
arch: Win32
winarch: win32
- name: Ubuntu (GCC)
os: ubuntu-latest
triplet: x64-linux
cc: gcc
cxx: g++
arch: amd64
experimental: false
env:
# Indicates the CMake build directory where project files and binaries are being produced.
CMAKE_BUILD_DIR: ${{ github.workspace }}/build/
# Indicates the location of the vcpkg as a Git submodule of the project repository.
#VCPKG_ROOT: ${{ github.workspace }}/vcpkg
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libsdl2-dev libsdl2-ttf-dev libsdl2-gfx-dev libsdl2-image-dev libsdl2-mixer-dev
if: matrix.os == 'ubuntu-latest'
- name: Show content of workspace after cache has been restored
run: find $RUNNER_WORKSPACE
shell: bash
# On Windows runners, let's ensure to have the Developer Command Prompt environment setup correctly. As used here the Developer Command Prompt created is targeting x64 and using the default the Windows SDK.
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
if: matrix.os == 'windows-latest'
# Run CMake to generate Ninja project files, using the vcpkg's toolchain file to resolve and install the dependencies as specified in vcpkg.json.
- name: Install dependencies and generate project files (Linux)
run: |
cmake -DBOX2D_BUILD_TESTBED=OFF -DBOX2D_BUILD_UNIT_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -B "${{ env.CMAKE_BUILD_DIR }}"
if: matrix.os == 'ubuntu-latest'
- name: Install dependencies and generate project files (Windows)
run: |
cmake -DCMAKE_BUILD_TYPE=Release -B "${{ env.CMAKE_BUILD_DIR }}" -A ${{matrix.arch}}
if: matrix.os == 'windows-latest'
# Build the whole project with Ninja (which is spawn by CMake).
- name: Build
run: |
cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target CapitalWorld --config Release -j 8
- name: version linux
run: echo "version=$(cat ${{ env.CMAKE_BUILD_DIR }}/VERSION.TXT)" >> $GITHUB_OUTPUT
id: version-linux
if: matrix.os == 'ubuntu-latest'
- name: version windows
working-directory: build
run: |
cd ${{ env.CMAKE_BUILD_DIR }}
echo "version=$(cat ${{ env.CMAKE_BUILD_DIR }}/VERSION.TXT)" >> $Env:GITHUB_OUTPUT
id: version-windows
if: matrix.os == 'windows-latest'
- name: Build Packages Linux
working-directory: build
run: |
make package
if: matrix.os == 'ubuntu-latest'
- name: Build Packages Windows
working-directory: build
run: |
cpack -G ZIP -C Release
if: matrix.os == 'windows-latest'
- name: upload linux artifact
uses: softprops/action-gh-release@v1
with:
files: |
${{ env.CMAKE_BUILD_DIR }}/CapitalWorld-${{ steps.version-linux.outputs.version }}-Linux.deb
${{ env.CMAKE_BUILD_DIR }}/CapitalWorld-${{ steps.version-linux.outputs.version }}-Linux.tar.gz
token: ${{ github.token }}
env:
GITHUB_REPOSITORY: hisoka999/CapitalWorld
if: matrix.os == 'ubuntu-latest'
- name: upload windows artifact (zip)
uses: softprops/action-gh-release@v1
with:
files: ${{ env.CMAKE_BUILD_DIR }}\CapitalWorld-${{ steps.version-windows.outputs.version }}-${{matrix.winarch}}.zip
token: ${{ github.token }}
env:
GITHUB_REPOSITORY: hisoka999/CapitalWorld
if: matrix.os == 'windows-latest'