forked from tiltedphoques/TiltedEvolution
-
Notifications
You must be signed in to change notification settings - Fork 1
111 lines (95 loc) · 3.38 KB
/
Copy pathlinux.yml
File metadata and controls
111 lines (95 loc) · 3.38 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Build linux
on:
pull_request:
push:
branches:
- master
workflow_call:
inputs:
build-mode:
required: false
type: string
default: releasedbg
upload-build-for-next-job:
required: false
type: boolean
default: false
env:
BUILD_MODE: ${{ inputs.build-mode || 'releasedbg' }}
jobs:
build:
strategy:
matrix:
include:
- arch: amd64
runner: ubuntu-24.04
- arch: arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
steps:
- uses: actions/checkout@v7
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'
run: |
test "$(git rev-parse HEAD)" = "$(git rev-parse origin/master)"
git checkout -B master HEAD
- name: Cache xmake dependencies
uses: actions/cache@v6
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: 3.1.0
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="$BUILD_MODE" --yes -vD
# Build the server
- name: Build
run: xmake -y
- name: Stage Linux server
run: |
xmake install -o packaged
install -d release-stage
install -m 755 packaged/bin/SkyrimTogetherServer release-stage/
install -m 644 packaged/lib/libSTServer.so release-stage/
- name: Verify Linux binary architecture
run: |
file release-stage/SkyrimTogetherServer
case "${{ matrix.arch }}" in
amd64) file release-stage/SkyrimTogetherServer | grep -Eq 'x86-64|x86_64' ;;
arm64) file release-stage/SkyrimTogetherServer | grep -Eqi 'aarch64|arm64' ;;
esac
- name: Generate default server config
run: |
./release-stage/SkyrimTogetherServer --generate-config release-stage/config/STServer.ini
cat release-stage/config/STServer.ini
- name: Create Linux release archive
if: ${{ inputs.upload-build-for-next-job }}
run: |
version="${GITHUB_REF_NAME#v}"
echo "ARTIFACT_VERSION=$version" >> "$GITHUB_ENV"
mkdir -p release-assets
tar -C release-stage -czf \
"release-assets/SkyrimTogetherServer-${version}-linux-${{ matrix.arch }}.tar.gz" \
.
# Upload artifacts
- name: Upload build files for the next job
if: ${{ inputs.upload-build-for-next-job }}
uses: actions/upload-artifact@v7
with:
name: release-asset-linux-${{ matrix.arch }}
retention-days: 1
if-no-files-found: error
path: release-assets/SkyrimTogetherServer-${{ env.ARTIFACT_VERSION }}-linux-${{ matrix.arch }}.tar.gz