forked from tiltedphoques/TiltedEvolution
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (75 loc) · 2.59 KB
/
linux.yml
File metadata and controls
87 lines (75 loc) · 2.59 KB
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
name: Build linux
on:
pull_request:
push:
branches:
- master
workflow_call:
inputs:
build-mode:
required: true
type: string
default: 'releasedbg'
upload-build-for-next-job:
required: true
type: boolean
default: false
jobs:
build:
strategy:
matrix:
include:
- arch: amd64
runner: ubuntu-latest
- arch: arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
steps:
- uses: actions/checkout@v4
with:
# We need full history in order to create a version string (BuildInfo.h)
fetch-depth: 0
- name: Checkout submodules
run: |
git submodule sync --recursive
git submodule update --init --force --recursive --depth=1
- name: Checkout master on tag push
if: github.ref_type == 'tag'
# Checkout only if the tag was pushed to master
run: '[ "$(git rev-parse HEAD)" = "$(git rev-parse origin/master)" ] && git checkout master'
- name: Cache xmake dependencies
uses: actions/cache@v4
with:
path: ~/.xmake/packages
key: ${{ matrix.runner }}-xmake-${{ hashFiles('**/xmake.lua') }}
# Install xmake
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: 2.9.8
actions-cache-folder: '.xmake-cache' # This doesn't cache dependencies, only xmake itself
actions-cache-key: ${{ matrix.runner }}
- name: Configure xmake and install dependencies
run: xmake config --mode=${{ inputs.build-mode }} --yes -vD
# Build the server
- name: Build
run: |
xmake -y
echo "STR_BUILD_DIR=build/linux/${{ matrix.arch }}/${{ inputs.build-mode }}" >> $GITHUB_ENV
# Create install
- name: Output distrib binaries via xmake
run: |
xmake install -o packaged
mkdir -p ${{ env.STR_BUILD_DIR }}
cp packaged/lib/libSTServer.so ${{ env.STR_BUILD_DIR }}/
cp packaged/bin/crashpad_handler ${{ env.STR_BUILD_DIR }}/
cp packaged/bin/SkyrimTogetherServer ${{ env.STR_BUILD_DIR }}/
# Upload artifacts
- name: Upload build files for the next job
if: ${{ inputs.upload-build-for-next-job }}
uses: actions/upload-artifact@v4
with:
name: internal-job-files-linux-${{ matrix.arch }}-${{ inputs.build-mode }}
retention-days: 1
path: ${{ env.STR_BUILD_DIR }}