Skip to content

added encypt, Update v2.2.3 #6

added encypt, Update v2.2.3

added encypt, Update v2.2.3 #6

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- { os: windows-latest, arch: x64, name: windows-x64, bedrock: false }
- { os: windows-latest, arch: arm64, name: windows-arm64, bedrock: false }
- { os: macos-latest, arch: x86_64, name: macos-x64, bedrock: false }
- { os: macos-latest, arch: arm64, name: macos-arm64, bedrock: false }
- { os: ubuntu-latest, arch: x86_64, name: linux-x64, bedrock: false }
- { os: ubuntu-latest, arch: aarch64, name: linux-arm64, bedrock: false }
- { os: windows-latest, arch: x64, name: windows-x64-bedrock, bedrock: true }
- { os: windows-latest, arch: arm64, name: windows-arm64-bedrock,bedrock: true }
- { os: macos-latest, arch: x86_64, name: macos-x64-bedrock, bedrock: true }
- { os: macos-latest, arch: arm64, name: macos-arm64-bedrock, bedrock: true }
- { os: ubuntu-latest, arch: x86_64, name: linux-x64-bedrock, bedrock: true }
- { os: ubuntu-latest, arch: aarch64, name: linux-arm64-bedrock, bedrock: true }
runs-on: ${{ matrix.os }}
name: Build (${{ matrix.name }})
steps:
- uses: actions/checkout@v4
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: latest
- name: Build Release
run: |
xmake f -m release --bedrock=${{ matrix.bedrock && 'y' || 'n' }} -a ${{ matrix.arch }} -y
xmake build -y
- name: Package Release (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$tag = "${{ github.ref_name }}"
$name = "fishnet-${tag}-${{ matrix.name }}-release"
New-Item -ItemType Directory -Path "dist/$name/include","dist/$name/lib","dist/$name/bin" -Force
Copy-Item -Recurse "include/*" "dist/$name/include/"
if ("${{ matrix.bedrock }}" -eq "true") { Copy-Item -Recurse -Force "include-bedrock/*" "dist/$name/include/" }
Copy-Item "LICENSE" "dist/$name/"
$bin = "bin/release/windows"
if (Test-Path "$bin/fishnet.dll") { Copy-Item "$bin/fishnet.dll" "dist/$name/bin/" }
if (Test-Path "$bin/fishnet.lib") { Copy-Item "$bin/fishnet.lib" "dist/$name/lib/" }
Compress-Archive -Path "dist/$name" -DestinationPath "dist/$name.zip"
- name: Package Release (macOS/Linux)
if: runner.os != 'Windows'
run: |
TAG="${{ github.ref_name }}"
NAME="fishnet-${TAG}-${{ matrix.name }}-release"
mkdir -p "dist/${NAME}/include" "dist/${NAME}/lib" "dist/${NAME}/bin"
cp -r include/* "dist/${NAME}/include/"
[ "${{ matrix.bedrock }}" = "true" ] && cp -r include-bedrock/* "dist/${NAME}/include/"
cp LICENSE "dist/${NAME}/"
PLAT=$([ "$(uname)" = "Darwin" ] && echo "macosx" || echo "linux")
cp bin/release/${PLAT}/libfishnet.* "dist/${NAME}/lib/" 2>/dev/null || true
cd dist && zip -r "${NAME}.zip" "${NAME}"
- name: Build Debug
run: |
xmake f -m debug --bedrock=${{ matrix.bedrock && 'y' || 'n' }} -a ${{ matrix.arch }} -y
xmake build -y
- name: Package Debug (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$tag = "${{ github.ref_name }}"
$name = "fishnet-${tag}-${{ matrix.name }}-debug"
New-Item -ItemType Directory -Path "dist/$name/include","dist/$name/lib","dist/$name/bin" -Force
Copy-Item -Recurse "include/*" "dist/$name/include/"
if ("${{ matrix.bedrock }}" -eq "true") { Copy-Item -Recurse -Force "include-bedrock/*" "dist/$name/include/" }
Copy-Item "LICENSE" "dist/$name/"
$bin = "bin/debug/windows"
if (Test-Path "$bin/fishnet.dll") { Copy-Item "$bin/fishnet.dll" "dist/$name/bin/" }
if (Test-Path "$bin/fishnet.lib") { Copy-Item "$bin/fishnet.lib" "dist/$name/lib/" }
if (Test-Path "$bin/fishnet.pdb") { Copy-Item "$bin/fishnet.pdb" "dist/$name/bin/" }
Compress-Archive -Path "dist/$name" -DestinationPath "dist/$name.zip"
- name: Package Debug (macOS/Linux)
if: runner.os != 'Windows'
run: |
TAG="${{ github.ref_name }}"
NAME="fishnet-${TAG}-${{ matrix.name }}-debug"
mkdir -p "dist/${NAME}/include" "dist/${NAME}/lib" "dist/${NAME}/bin"
cp -r include/* "dist/${NAME}/include/"
[ "${{ matrix.bedrock }}" = "true" ] && cp -r include-bedrock/* "dist/${NAME}/include/"
cp LICENSE "dist/${NAME}/"
PLAT=$([ "$(uname)" = "Darwin" ] && echo "macosx" || echo "linux")
cp bin/debug/${PLAT}/libfishnet.* "dist/${NAME}/lib/" 2>/dev/null || true
cd dist && zip -r "${NAME}.zip" "${NAME}"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: fishnet-${{ matrix.name }}
path: dist/*.zip
release:
needs: build
runs-on: ubuntu-latest
name: Publish Release
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Extract changelog for this tag
id: changelog
run: |
TAG="${{ github.ref_name }}"
BODY=$(awk "/^## \[${TAG}\]/{flag=1; next} /^## \[/{flag=0} flag" CHANGELOG.md)
if [ -z "$BODY" ]; then
BODY="Release ${TAG}"
fi
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "$BODY" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Collect zip files
run: |
mkdir release-files
find artifacts/ -name "*.zip" -exec cp {} release-files/ \;
ls -la release-files/
- name: Generate SHA256 checksums
id: sha256
run: |
cd release-files
sha256sum *.zip > SHA256SUMS.txt
cat SHA256SUMS.txt
echo "sums<<EOF" >> $GITHUB_OUTPUT
cat SHA256SUMS.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: FishNet ${{ github.ref_name }}
body: |
${{ steps.changelog.outputs.body }}
## License
GPL-3.0 — see [LICENSE](LICENSE).
Original RakNet: https://github.com/facebookarchive/RakNet (BSD 2-Clause)
files: |
release-files/*.zip
release-files/SHA256SUMS.txt
draft: false
prerelease: ${{ contains(github.ref_name, '-A') || contains(github.ref_name, '-B') || contains(github.ref_name, '-RC') }}