Skip to content

Commit 981535f

Browse files
committed
fix problems
1 parent 72be3b9 commit 981535f

3 files changed

Lines changed: 110 additions & 107 deletions

File tree

.github/workflows/build.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,12 @@ jobs:
4242
with:
4343
xmake-version: latest
4444

45-
- name: Configure
46-
run: xmake f -m release --bedrock=y -a ${{ matrix.arch }} -y
47-
48-
- name: Build
49-
run: xmake build -y
50-
51-
- name: Upload artifact
52-
uses: actions/upload-artifact@v4
53-
with:
54-
name: fishnet-${{ matrix.name }}
55-
path: bin/
45+
- name: Build Release
46+
run: |
47+
xmake f -m release --bedrock=y -a ${{ matrix.arch }} -y
48+
xmake build -y
49+
50+
- name: Build Debug
51+
run: |
52+
xmake f -m debug --bedrock=y -a ${{ matrix.arch }} -y
53+
xmake build -y

.github/workflows/release.yml

Lines changed: 95 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -14,55 +14,19 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
include:
17-
- os: windows-latest
18-
arch: x64
19-
name: windows-x64
20-
bedrock: false
21-
- os: windows-latest
22-
arch: arm64
23-
name: windows-arm64
24-
bedrock: false
25-
- os: macos-latest
26-
arch: x86_64
27-
name: macos-x64
28-
bedrock: false
29-
- os: macos-latest
30-
arch: arm64
31-
name: macos-arm64
32-
bedrock: false
33-
- os: ubuntu-latest
34-
arch: x86_64
35-
name: linux-x64
36-
bedrock: false
37-
- os: ubuntu-latest
38-
arch: aarch64
39-
name: linux-arm64
40-
bedrock: false
41-
42-
- os: windows-latest
43-
arch: x64
44-
name: windows-x64-bedrock
45-
bedrock: true
46-
- os: windows-latest
47-
arch: arm64
48-
name: windows-arm64-bedrock
49-
bedrock: true
50-
- os: macos-latest
51-
arch: x86_64
52-
name: macos-x64-bedrock
53-
bedrock: true
54-
- os: macos-latest
55-
arch: arm64
56-
name: macos-arm64-bedrock
57-
bedrock: true
58-
- os: ubuntu-latest
59-
arch: x86_64
60-
name: linux-x64-bedrock
61-
bedrock: true
62-
- os: ubuntu-latest
63-
arch: aarch64
64-
name: linux-arm64-bedrock
65-
bedrock: true
17+
- { os: windows-latest, arch: x64, name: windows-x64, bedrock: false }
18+
- { os: windows-latest, arch: arm64, name: windows-arm64, bedrock: false }
19+
- { os: macos-latest, arch: x86_64, name: macos-x64, bedrock: false }
20+
- { os: macos-latest, arch: arm64, name: macos-arm64, bedrock: false }
21+
- { os: ubuntu-latest, arch: x86_64, name: linux-x64, bedrock: false }
22+
- { os: ubuntu-latest, arch: aarch64, name: linux-arm64, bedrock: false }
23+
24+
- { os: windows-latest, arch: x64, name: windows-x64-bedrock, bedrock: true }
25+
- { os: windows-latest, arch: arm64, name: windows-arm64-bedrock,bedrock: true }
26+
- { os: macos-latest, arch: x86_64, name: macos-x64-bedrock, bedrock: true }
27+
- { os: macos-latest, arch: arm64, name: macos-arm64-bedrock, bedrock: true }
28+
- { os: ubuntu-latest, arch: x86_64, name: linux-x64-bedrock, bedrock: true }
29+
- { os: ubuntu-latest, arch: aarch64, name: linux-arm64-bedrock, bedrock: true }
6630

6731
runs-on: ${{ matrix.os }}
6832
name: Build (${{ matrix.name }})
@@ -75,50 +39,78 @@ jobs:
7539
with:
7640
xmake-version: latest
7741

78-
- name: Configure
79-
run: xmake f -m release --bedrock=${{ matrix.bedrock && 'y' || 'n' }} -a ${{ matrix.arch }} -y
42+
- name: Build Release
43+
run: |
44+
xmake f -m release --bedrock=${{ matrix.bedrock && 'y' || 'n' }} -a ${{ matrix.arch }} -y
45+
xmake build -y
46+
47+
- name: Package Release (Windows)
48+
if: runner.os == 'Windows'
49+
shell: pwsh
50+
run: |
51+
$tag = "${{ github.ref_name }}"
52+
$name = "fishnet-${tag}-${{ matrix.name }}-release"
53+
New-Item -ItemType Directory -Path "dist/$name/include","dist/$name/lib","dist/$name/bin" -Force
54+
Copy-Item -Recurse "src/include/*" "dist/$name/include/"
55+
if ("${{ matrix.bedrock }}" -eq "true") { Copy-Item -Recurse "src-bedrock/include/*" "dist/$name/include/" }
56+
Copy-Item "LICENSE" "dist/$name/"
57+
$bin = "bin/release/windows"
58+
if (Test-Path "$bin/fishnet.dll") { Copy-Item "$bin/fishnet.dll" "dist/$name/bin/" }
59+
if (Test-Path "$bin/fishnet.lib") { Copy-Item "$bin/fishnet.lib" "dist/$name/lib/" }
60+
Get-ChildItem "$bin/example_*" -ErrorAction SilentlyContinue | Copy-Item -Destination "dist/$name/bin/"
61+
Compress-Archive -Path "dist/$name" -DestinationPath "dist/$name.zip"
62+
63+
- name: Package Release (macOS/Linux)
64+
if: runner.os != 'Windows'
65+
run: |
66+
TAG="${{ github.ref_name }}"
67+
NAME="fishnet-${TAG}-${{ matrix.name }}-release"
68+
mkdir -p "dist/${NAME}/include" "dist/${NAME}/lib" "dist/${NAME}/bin"
69+
cp -r src/include/* "dist/${NAME}/include/"
70+
[ "${{ matrix.bedrock }}" = "true" ] && cp -r src-bedrock/include/* "dist/${NAME}/include/"
71+
cp LICENSE "dist/${NAME}/"
72+
PLAT=$([ "$(uname)" = "Darwin" ] && echo "macosx" || echo "linux")
73+
cp bin/release/${PLAT}/libfishnet.* "dist/${NAME}/lib/" 2>/dev/null || true
74+
cp bin/release/${PLAT}/example_* "dist/${NAME}/bin/" 2>/dev/null || true
75+
cd dist && zip -r "${NAME}.zip" "${NAME}"
8076
81-
- name: Build
82-
run: xmake build -y
77+
- name: Build Debug
78+
run: |
79+
xmake f -m debug --bedrock=${{ matrix.bedrock && 'y' || 'n' }} -a ${{ matrix.arch }} -y
80+
xmake build -y
8381
84-
- name: Package (Windows)
82+
- name: Package Debug (Windows)
8583
if: runner.os == 'Windows'
8684
shell: pwsh
8785
run: |
8886
$tag = "${{ github.ref_name }}"
89-
$archiveName = "fishnet-${tag}-${{ matrix.name }}"
90-
New-Item -ItemType Directory -Path "dist/$archiveName/include" -Force
91-
New-Item -ItemType Directory -Path "dist/$archiveName/lib" -Force
92-
New-Item -ItemType Directory -Path "dist/$archiveName/bin" -Force
93-
Copy-Item -Recurse "src/include/*" "dist/$archiveName/include/"
94-
if ("${{ matrix.bedrock }}" -eq "true") {
95-
Copy-Item -Recurse "src-bedrock/include/*" "dist/$archiveName/include/"
96-
}
97-
Copy-Item "LICENSE" "dist/$archiveName/"
98-
$binDir = "bin/release/windows"
99-
if (Test-Path "$binDir/fishnet.dll") { Copy-Item "$binDir/fishnet.dll" "dist/$archiveName/bin/" }
100-
if (Test-Path "$binDir/fishnet.lib") { Copy-Item "$binDir/fishnet.lib" "dist/$archiveName/lib/" }
101-
Get-ChildItem "$binDir/example_*" -ErrorAction SilentlyContinue | Copy-Item -Destination "dist/$archiveName/bin/"
102-
Compress-Archive -Path "dist/$archiveName" -DestinationPath "dist/$archiveName.zip"
103-
104-
- name: Package (macOS/Linux)
87+
$name = "fishnet-${tag}-${{ matrix.name }}-debug"
88+
New-Item -ItemType Directory -Path "dist/$name/include","dist/$name/lib","dist/$name/bin" -Force
89+
Copy-Item -Recurse "src/include/*" "dist/$name/include/"
90+
if ("${{ matrix.bedrock }}" -eq "true") { Copy-Item -Recurse "src-bedrock/include/*" "dist/$name/include/" }
91+
Copy-Item "LICENSE" "dist/$name/"
92+
$bin = "bin/debug/windows"
93+
if (Test-Path "$bin/fishnet.dll") { Copy-Item "$bin/fishnet.dll" "dist/$name/bin/" }
94+
if (Test-Path "$bin/fishnet.lib") { Copy-Item "$bin/fishnet.lib" "dist/$name/lib/" }
95+
if (Test-Path "$bin/fishnet.pdb") { Copy-Item "$bin/fishnet.pdb" "dist/$name/bin/" }
96+
Get-ChildItem "$bin/example_*" -ErrorAction SilentlyContinue | Copy-Item -Destination "dist/$name/bin/"
97+
Compress-Archive -Path "dist/$name" -DestinationPath "dist/$name.zip"
98+
99+
- name: Package Debug (macOS/Linux)
105100
if: runner.os != 'Windows'
106101
run: |
107102
TAG="${{ github.ref_name }}"
108-
ARCHIVE="fishnet-${TAG}-${{ matrix.name }}"
109-
mkdir -p "dist/${ARCHIVE}/include" "dist/${ARCHIVE}/lib" "dist/${ARCHIVE}/bin"
110-
cp -r src/include/* "dist/${ARCHIVE}/include/"
111-
if [ "${{ matrix.bedrock }}" = "true" ]; then
112-
cp -r src-bedrock/include/* "dist/${ARCHIVE}/include/"
113-
fi
114-
cp LICENSE "dist/${ARCHIVE}/"
103+
NAME="fishnet-${TAG}-${{ matrix.name }}-debug"
104+
mkdir -p "dist/${NAME}/include" "dist/${NAME}/lib" "dist/${NAME}/bin"
105+
cp -r src/include/* "dist/${NAME}/include/"
106+
[ "${{ matrix.bedrock }}" = "true" ] && cp -r src-bedrock/include/* "dist/${NAME}/include/"
107+
cp LICENSE "dist/${NAME}/"
115108
PLAT=$([ "$(uname)" = "Darwin" ] && echo "macosx" || echo "linux")
116-
BINDIR="bin/release/${PLAT}"
117-
cp ${BINDIR}/libfishnet.* "dist/${ARCHIVE}/lib/" 2>/dev/null || true
118-
cp ${BINDIR}/example_* "dist/${ARCHIVE}/bin/" 2>/dev/null || true
119-
cd dist && zip -r "${ARCHIVE}.zip" "${ARCHIVE}"
109+
cp bin/debug/${PLAT}/libfishnet.* "dist/${NAME}/lib/" 2>/dev/null || true
110+
cp bin/debug/${PLAT}/example_* "dist/${NAME}/bin/" 2>/dev/null || true
111+
cd dist && zip -r "${NAME}.zip" "${NAME}"
120112
121-
- name: Upload artifact
113+
- name: Upload artifacts
122114
uses: actions/upload-artifact@v4
123115
with:
124116
name: fishnet-${{ matrix.name }}
@@ -175,24 +167,36 @@ jobs:
175167
176168
## Downloads
177169
178-
**Core** (generic RakNet, no Bedrock):
179-
`fishnet-${{ github.ref_name }}-<platform>.zip`
170+
**Core** (generic RakNet):
171+
| Platform | Release | Debug |
172+
|----------|---------|-------|
173+
| Windows x64 | `fishnet-${{ github.ref_name }}-windows-x64-release.zip` | `fishnet-${{ github.ref_name }}-windows-x64-debug.zip` |
174+
| Windows arm64 | `fishnet-${{ github.ref_name }}-windows-arm64-release.zip` | `fishnet-${{ github.ref_name }}-windows-arm64-debug.zip` |
175+
| macOS x64 | `fishnet-${{ github.ref_name }}-macos-x64-release.zip` | `fishnet-${{ github.ref_name }}-macos-x64-debug.zip` |
176+
| macOS arm64 | `fishnet-${{ github.ref_name }}-macos-arm64-release.zip` | `fishnet-${{ github.ref_name }}-macos-arm64-debug.zip` |
177+
| Linux x64 | `fishnet-${{ github.ref_name }}-linux-x64-release.zip` | `fishnet-${{ github.ref_name }}-linux-x64-debug.zip` |
178+
| Linux arm64 | `fishnet-${{ github.ref_name }}-linux-arm64-release.zip` | `fishnet-${{ github.ref_name }}-linux-arm64-debug.zip` |
180179
181180
**Bedrock** (core + Minecraft Bedrock extension):
182-
`fishnet-${{ github.ref_name }}-<platform>-bedrock.zip`
181+
| Platform | Release | Debug |
182+
|----------|---------|-------|
183+
| Windows x64 | `fishnet-${{ github.ref_name }}-windows-x64-bedrock-release.zip` | `fishnet-${{ github.ref_name }}-windows-x64-bedrock-debug.zip` |
184+
| Windows arm64 | `fishnet-${{ github.ref_name }}-windows-arm64-bedrock-release.zip` | `fishnet-${{ github.ref_name }}-windows-arm64-bedrock-debug.zip` |
185+
| macOS x64 | `fishnet-${{ github.ref_name }}-macos-x64-bedrock-release.zip` | `fishnet-${{ github.ref_name }}-macos-x64-bedrock-debug.zip` |
186+
| macOS arm64 | `fishnet-${{ github.ref_name }}-macos-arm64-bedrock-release.zip` | `fishnet-${{ github.ref_name }}-macos-arm64-bedrock-debug.zip` |
187+
| Linux x64 | `fishnet-${{ github.ref_name }}-linux-x64-bedrock-release.zip` | `fishnet-${{ github.ref_name }}-linux-x64-bedrock-debug.zip` |
188+
| Linux arm64 | `fishnet-${{ github.ref_name }}-linux-arm64-bedrock-release.zip` | `fishnet-${{ github.ref_name }}-linux-arm64-bedrock-debug.zip` |
189+
190+
> Debug builds include packet logging (`FISHNET_DEBUG`) and `.pdb` files on Windows.
183191
184192
## SHA256 Checksums
185193
```
186194
${{ steps.sha256.outputs.sums }}
187195
```
188196
189197
## License
190-
GPL-3.0 — see [LICENSE](LICENSE) for details.
191-
192-
## Credits
193-
FishNet is a clean-room RakNet protocol implementation.
194-
Original RakNet by Jenkins Software / Oculus VR (BSD 2-Clause):
195-
https://github.com/facebookarchive/RakNet
198+
GPL-3.0 — see [LICENSE](LICENSE).
199+
Original RakNet: https://github.com/facebookarchive/RakNet (BSD 2-Clause)
196200
files: |
197201
release-files/*.zip
198202
release-files/SHA256SUMS.txt

xmake.lua

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,14 @@ rule("fishnet.shared")
5454
target:add("cxxflags", "-fvisibility=hidden")
5555
target:add("cxxflags", "-fvisibility-inlines-hidden")
5656
end
57-
5857
if target:is_plat("linux") then
5958
local ver = target:version()
60-
if ver then
61-
local major = ver:major()
62-
target:add("ldflags", "-Wl,-soname,lib" .. target:name() .. ".so." .. major,
63-
{tools = {"gcc", "gxx", "clang", "clangxx"}})
59+
if ver and ver.major then
60+
local ok, major = pcall(function() return ver:major() end)
61+
if ok and major then
62+
target:add("ldflags", "-Wl,-soname,lib" .. target:name() .. ".so." .. major,
63+
{tools = {"gcc", "gxx", "clang", "clangxx"}})
64+
end
6465
end
6566
end
6667

0 commit comments

Comments
 (0)