forked from vmangos/core
-
Notifications
You must be signed in to change notification settings - Fork 5
142 lines (120 loc) · 4.27 KB
/
linux-development-release.yaml
File metadata and controls
142 lines (120 loc) · 4.27 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# Build and publish the Linux development release on pushes to development.
name: Linux Development Release
on:
push:
branches:
- development
paths-ignore:
- '.github/ISSUE_TEMPLATE.md'
- '.github/ISSUE_TEMPLATE/**'
- '.github/PULL_REQUEST_TEMPLATE.md'
- '.github/workflows/development-db-dump.yaml'
- '.github/workflows/pr-sql-check.yaml'
- '.gitignore'
- 'CONTRIBUTING.md'
- 'LICENSE'
- 'README.md'
- 'sql/**'
concurrency:
group: linux-development-release-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build Linux development release
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Install Ubuntu build dependencies
run: |
sudo apt update
sudo apt install -y --no-install-recommends \
build-essential \
cmake \
libmysqlclient-dev \
libssl-dev \
patchelf \
zlib1g-dev
- name: Build release binaries
run: |
set -euo pipefail
mkdir -p build _install
cd build
cmake ../ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/_install" \
-DBUILD_EXTRACTORS=1 \
-DBUILD_FOR_HOST_CPU=0 \
-DCONF_DIR:STRING=./etc \
-DDEBUG_SYMBOLS=0
make -j"$(nproc)"
make install
- name: Set release archive filename
run: |
echo "ARCHIVE_FILENAME=dev-linux-amd64-$(git rev-parse --short HEAD).tar.gz" >>"$GITHUB_ENV"
- name: Create release archive
run: |
set -euo pipefail
./.github/scripts/package-linux-release.sh _install "$ARCHIVE_FILENAME"
- name: Smoke test release
run: |
set -euo pipefail
cat >smoke-test-linux-release.sh <<'SMOKE_TEST'
#!/usr/bin/env bash
set -euo pipefail
mkdir -p /tmp/vmangos-release
tar -xzf /tmp/release.tar.gz -C /tmp/vmangos-release
/tmp/vmangos-release/vmangos-linux-amd64/bin/realmd --version
/tmp/vmangos-release/vmangos-linux-amd64/bin/mangosd --version
while IFS= read -r -d '' file; do
magic="$(head -c 4 "$file" 2>/dev/null || true)"
if [ "$magic" = $'\177ELF' ]; then
ldd "$file"
fi
done < <(find /tmp/vmangos-release/vmangos-linux-amd64 -type f -print0) >/tmp/ldd-output.txt
if grep -q "not found" /tmp/ldd-output.txt; then
cat /tmp/ldd-output.txt
exit 1
fi
SMOKE_TEST
docker run --rm --platform linux/amd64 \
-v "$GITHUB_WORKSPACE/bin/$ARCHIVE_FILENAME:/tmp/release.tar.gz:ro" \
-v "$PWD/smoke-test-linux-release.sh:/tmp/smoke-test-linux-release.sh:ro" \
ubuntu:24.04 \
bash /tmp/smoke-test-linux-release.sh
- name: Upload release artifact
uses: actions/upload-artifact@v7
with:
name: linux-development-build
path: "${{ github.workspace }}/bin/${{ env.ARCHIVE_FILENAME }}"
publish:
name: Publish Linux development release
needs: build
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Download release artifact
uses: actions/download-artifact@v8
with:
pattern: linux-development-build
merge-multiple: true
path: release-assets
- name: Write release notes preamble
run: |
cat >linux-release-notes.md <<'RELEASE_NOTES'
## Compatibility
This Linux development build is for `amd64` systems using `glibc` 2.39 or newer.
It is built on Ubuntu 24.04 and bundles non-`glibc` runtime libraries.
It is not expected to run on Alpine/`musl` or older `glibc` systems.
RELEASE_NOTES
- name: Publish release snapshot
env:
GH_TOKEN: ${{ github.token }}
run: ./.github/scripts/publish-moving-release.sh linux_latest "Linux Development Build" release-assets linux-release-notes.md