mirror of
https://github.com/alterware/iw4-validator.git
synced 2025-04-19 00:22:54 +00:00
build: remove Docker since it's useless and refactor CI (#6)
This commit is contained in:
commit
3b1787a185
103
.github/workflows/build.yml
vendored
103
.github/workflows/build.yml
vendored
@ -16,7 +16,7 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PREMAKE_VERSION: "5.0.0-beta2"
|
PREMAKE_VERSION: "5.0.0-beta6"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-windows:
|
build-windows:
|
||||||
@ -26,8 +26,10 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
configuration:
|
configuration:
|
||||||
- debug
|
|
||||||
- release
|
- release
|
||||||
|
compiler:
|
||||||
|
- msvc
|
||||||
|
- clang
|
||||||
arch:
|
arch:
|
||||||
- x86
|
- x86
|
||||||
- x64
|
- x64
|
||||||
@ -55,19 +57,24 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: ${{ env.PREMAKE_VERSION }}
|
version: ${{ env.PREMAKE_VERSION }}
|
||||||
|
|
||||||
- name: Generate project files
|
- name: Generate project files (clang)
|
||||||
|
if: matrix.compiler == 'clang'
|
||||||
|
run: premake5 --cc=${{matrix.compiler}} vs2022
|
||||||
|
|
||||||
|
- name: Generate project files (msvc)
|
||||||
|
if: matrix.compiler == 'msvc'
|
||||||
run: premake5 vs2022
|
run: premake5 vs2022
|
||||||
|
|
||||||
- name: Set up problem matching
|
- name: Set up problem matching
|
||||||
uses: ammaraskar/msvc-problem-matcher@master
|
uses: ammaraskar/msvc-problem-matcher@master
|
||||||
|
|
||||||
- name: Build ${{matrix.arch}} ${{matrix.configuration}} binaries
|
- name: Build ${{matrix.arch}} ${{matrix.configuration}} ${{matrix.compiler}} binaries
|
||||||
run: msbuild /m /v:minimal /p:Configuration=${{matrix.configuration}} /p:Platform=${{matrix.platform}} build/iw4-validator.sln
|
run: msbuild /m /p:Configuration=${{matrix.configuration}} /p:Platform=${{matrix.platform}} build/iw4-validator.sln
|
||||||
|
|
||||||
- name: Upload ${{matrix.arch}} ${{matrix.configuration}} binaries
|
- name: Upload ${{matrix.arch}} ${{matrix.configuration}} ${{matrix.compiler}} binaries
|
||||||
uses: actions/upload-artifact@main
|
uses: actions/upload-artifact@main
|
||||||
with:
|
with:
|
||||||
name: windows-${{matrix.arch}}-${{matrix.configuration}}
|
name: windows-${{matrix.arch}}-${{matrix.configuration}}-${{matrix.compiler}}
|
||||||
path: |
|
path: |
|
||||||
build/bin/${{matrix.arch}}/${{matrix.configuration}}/iw4-validator.exe
|
build/bin/${{matrix.arch}}/${{matrix.configuration}}/iw4-validator.exe
|
||||||
build/bin/${{matrix.arch}}/${{matrix.configuration}}/iw4-validator.pdb
|
build/bin/${{matrix.arch}}/${{matrix.configuration}}/iw4-validator.pdb
|
||||||
@ -75,17 +82,22 @@ jobs:
|
|||||||
build-linux:
|
build-linux:
|
||||||
name: Build Linux
|
name: Build Linux
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container: ubuntu:noble
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
configuration:
|
configuration:
|
||||||
- debug
|
|
||||||
- release
|
- release
|
||||||
arch:
|
arch:
|
||||||
- x86
|
- x86
|
||||||
- x64
|
- amd64
|
||||||
- arm64
|
- arm64
|
||||||
steps:
|
steps:
|
||||||
|
- name: Install g++ and multilib
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y wget tar git make gcc g++ gcc-multilib g++-multilib
|
||||||
|
|
||||||
- name: Check out files
|
- name: Check out files
|
||||||
uses: actions/checkout@main
|
uses: actions/checkout@main
|
||||||
with:
|
with:
|
||||||
@ -96,15 +108,15 @@ jobs:
|
|||||||
- name: Install dependencies (arm64)
|
- name: Install dependencies (arm64)
|
||||||
if: matrix.arch == 'arm64'
|
if: matrix.arch == 'arm64'
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
apt-get update
|
||||||
sudo apt-get install crossbuild-essential-arm64 -y
|
apt-get install -y crossbuild-essential-arm64
|
||||||
|
|
||||||
- name: Install dependencies (x86)
|
- name: Install dependencies (x86)
|
||||||
if: matrix.arch == 'x86'
|
if: matrix.arch == 'x86'
|
||||||
run: |
|
run: |
|
||||||
sudo dpkg --add-architecture i386
|
dpkg --add-architecture i386
|
||||||
sudo apt-get update
|
apt-get update
|
||||||
sudo apt-get -y install gcc-multilib g++-multilib
|
apt-get -y install gcc-multilib g++-multilib
|
||||||
|
|
||||||
- name: Install Premake5
|
- name: Install Premake5
|
||||||
uses: diamante0018/setup-premake@master
|
uses: diamante0018/setup-premake@master
|
||||||
@ -112,7 +124,7 @@ jobs:
|
|||||||
version: ${{ env.PREMAKE_VERSION }}
|
version: ${{ env.PREMAKE_VERSION }}
|
||||||
|
|
||||||
- name: Generate project files
|
- name: Generate project files
|
||||||
run: premake5 gmake2
|
run: premake5 gmake
|
||||||
|
|
||||||
- name: Set up problem matching
|
- name: Set up problem matching
|
||||||
uses: ammaraskar/gcc-problem-matcher@master
|
uses: ammaraskar/gcc-problem-matcher@master
|
||||||
@ -129,8 +141,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build ${{matrix.arch}} ${{matrix.configuration}} binaries
|
- name: Build ${{matrix.arch}} ${{matrix.configuration}} binaries
|
||||||
run: |
|
run: |
|
||||||
pushd build
|
make -C build config=${{matrix.configuration}}_${{matrix.arch}} -j$(nproc)
|
||||||
make config=${{matrix.configuration}}_${{matrix.arch}} -j$(nproc)
|
|
||||||
|
|
||||||
- name: Upload ${{matrix.arch}} ${{matrix.configuration}} binaries
|
- name: Upload ${{matrix.arch}} ${{matrix.configuration}} binaries
|
||||||
uses: actions/upload-artifact@main
|
uses: actions/upload-artifact@main
|
||||||
@ -165,61 +176,3 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload iw4-validator binary
|
- name: Upload iw4-validator binary
|
||||||
run: rsync -avz iw4-validator.exe ${{ secrets.ALTERWARE_MASTER_SSH_USER }}@${{ secrets.ALTERWARE_MASTER_SSH_ADDRESS }}:${{ env.ALTERWARE_MASTER_PATH }}/tools/
|
run: rsync -avz iw4-validator.exe ${{ secrets.ALTERWARE_MASTER_SSH_USER }}@${{ secrets.ALTERWARE_MASTER_SSH_ADDRESS }}:${{ env.ALTERWARE_MASTER_PATH }}/tools/
|
||||||
|
|
||||||
docker:
|
|
||||||
name: Create Docker Image
|
|
||||||
needs: [build-linux, build-windows]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.ref_type == 'tag'
|
|
||||||
steps:
|
|
||||||
- name: Check out files
|
|
||||||
uses: actions/checkout@main
|
|
||||||
with:
|
|
||||||
sparse-checkout: |
|
|
||||||
Dockerfile
|
|
||||||
README.md
|
|
||||||
sparse-checkout-cone-mode: false
|
|
||||||
|
|
||||||
- name: Download Release binaries
|
|
||||||
uses: actions/download-artifact@main
|
|
||||||
|
|
||||||
- name: Compress Binaries
|
|
||||||
run: |
|
|
||||||
for dir in */; do
|
|
||||||
if [[ $dir == *"windows"* ]]; then
|
|
||||||
cd "$dir" && zip -r "../${dir%/}.zip" . && cd ..
|
|
||||||
else
|
|
||||||
tar -czvf "${dir%/}.tar.gz" -C "$dir" .
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Setup Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3.3.0
|
|
||||||
|
|
||||||
- name: Login to DockerHub
|
|
||||||
uses: docker/login-action@v3.2.0
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USER }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- id: meta
|
|
||||||
uses: docker/metadata-action@v5.5.1
|
|
||||||
with:
|
|
||||||
images: |
|
|
||||||
alterware/iw4-validator
|
|
||||||
tags: |
|
|
||||||
${{ github.ref_name }}
|
|
||||||
latest
|
|
||||||
|
|
||||||
- name: Build and Push Docker Image
|
|
||||||
id: build-and-push
|
|
||||||
uses: docker/build-push-action@v5.3.0
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: linux/amd64
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
FROM alpine:latest
|
|
||||||
RUN apk add --no-cache gcompat libstdc++
|
|
||||||
|
|
||||||
COPY --chmod=755 ./linux-x64-release/iw4-validator /usr/local/bin/
|
|
||||||
|
|
||||||
RUN addgroup -S iw4 && adduser -S iw4 -G iw4
|
|
||||||
USER iw4
|
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/iw4-validator"]
|
|
@ -8,7 +8,7 @@ You may use this tool to validate "client effects" GSC files for the IW4 engine
|
|||||||
- Install [Premake5][premake5-link] and add it to your system PATH
|
- Install [Premake5][premake5-link] and add it to your system PATH
|
||||||
- Clone this repository using [Git][git-link]
|
- Clone this repository using [Git][git-link]
|
||||||
- Update the submodules using ``git submodule update --init --recursive``
|
- Update the submodules using ``git submodule update --init --recursive``
|
||||||
- Run Premake with either of these two options ``premake5 vs2022`` (Windows) or ``premake5 gmake2`` (Linux/macOS)
|
- Run Premake with either of these two options ``premake5 vs2022`` (Windows) or ``premake5 gmake`` (Linux/macOS)
|
||||||
|
|
||||||
#### Command line arguments
|
#### Command line arguments
|
||||||
|
|
||||||
|
34
premake5.lua
34
premake5.lua
@ -6,9 +6,11 @@ targetdir "%{wks.location}/bin/%{cfg.platform}/%{cfg.buildcfg}"
|
|||||||
|
|
||||||
configurations {"debug", "release"}
|
configurations {"debug", "release"}
|
||||||
|
|
||||||
if os.istarget("darwin") then
|
if os.istarget("linux") then
|
||||||
platforms {"x64", "arm64"}
|
platforms {"x86", "amd64", "arm64"}
|
||||||
else
|
elseif os.istarget("macosx") then
|
||||||
|
platforms {"amd64", "arm64"}
|
||||||
|
else
|
||||||
platforms {"x86", "x64", "arm64"}
|
platforms {"x86", "x64", "arm64"}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -20,6 +22,10 @@ filter "platforms:x64"
|
|||||||
architecture "x86_64"
|
architecture "x86_64"
|
||||||
filter {}
|
filter {}
|
||||||
|
|
||||||
|
filter "platforms:amd64"
|
||||||
|
architecture "x86_64"
|
||||||
|
filter {}
|
||||||
|
|
||||||
filter "platforms:arm64"
|
filter "platforms:arm64"
|
||||||
architecture "ARM64"
|
architecture "ARM64"
|
||||||
filter {}
|
filter {}
|
||||||
@ -39,7 +45,25 @@ filter {"system:linux", "system:macosx"}
|
|||||||
linkoptions "-pthread"
|
linkoptions "-pthread"
|
||||||
filter {}
|
filter {}
|
||||||
|
|
||||||
filter {"system:macosx", "platforms:arm64"}
|
if os.istarget("linux") then
|
||||||
|
-- this supports cross-compilation for arm64
|
||||||
|
filter { "toolset:clang*", "platforms:arm64" }
|
||||||
|
buildoptions "--target=arm64-linux-gnu"
|
||||||
|
linkoptions "--target=arm64-linux-gnu"
|
||||||
|
filter {}
|
||||||
|
|
||||||
|
filter { "toolset:clang*" }
|
||||||
|
-- always try to use lld. LD or Gold will not work
|
||||||
|
linkoptions "-fuse-ld=lld"
|
||||||
|
filter {}
|
||||||
|
end
|
||||||
|
|
||||||
|
filter { "system:macosx", "platforms:amd64" }
|
||||||
|
buildoptions "-arch x86_64"
|
||||||
|
linkoptions "-arch x86_64"
|
||||||
|
filter {}
|
||||||
|
|
||||||
|
filter { "system:macosx", "platforms:arm64" }
|
||||||
buildoptions "-arch arm64"
|
buildoptions "-arch arm64"
|
||||||
linkoptions "-arch arm64"
|
linkoptions "-arch arm64"
|
||||||
filter {}
|
filter {}
|
||||||
@ -53,7 +77,7 @@ flags {"NoIncrementalLink", "NoMinimalRebuild", "MultiProcessorCompile", "No64Bi
|
|||||||
filter "configurations:release"
|
filter "configurations:release"
|
||||||
optimize "Speed"
|
optimize "Speed"
|
||||||
defines "NDEBUG"
|
defines "NDEBUG"
|
||||||
flags "FatalCompileWarnings"
|
fatalwarnings {"All"}
|
||||||
filter {}
|
filter {}
|
||||||
|
|
||||||
filter "configurations:debug"
|
filter "configurations:debug"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user