Skip to content

Commit

Permalink
chore(ci): update CI workflows for compatibility and consistency (#74)
Browse files Browse the repository at this point in the history
- Updated action versions (`checkout@v4`, `upload-artifact@v4`, `download-artifact@v4`, `gh-release@v2`) for enhanced compatibility and security
- Upgraded MSBuild setup action to `v2`
- Switched to a Debian slim container for the Linux build to ensure compatibility
- Simplified dependency installation on Linux and included multilib support for 32-bit builds
- Removed unnecessary cleanup steps for temporary artifacts
- Ensured consistent action versions across jobs and steps

Co-authored-by: s1lentq <s1lentsk@yandex.ru>
  • Loading branch information
SergeyShorokhov and s1lentq authored Oct 29, 2024
1 parent cedda15 commit 011e823
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.1.3
uses: microsoft/setup-msbuild@v2

- name: Build
run: |
Expand All @@ -44,25 +44,36 @@ jobs:
move msvc\${{ env.buildRelease }}\metamod.pdb publish\debug\metamod.pdb
- name: Deploy artifacts
uses: actions/upload-artifact@v3.1.1
uses: actions/upload-artifact@v4
with:
name: win32
path: publish/*

linux:
name: 'Linux'
runs-on: ubuntu-latest
container: s1lentq/linux86buildtools:latest
container: debian:11-slim

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build using Intel C++ Compiler 19.0
- name: Install dependencies
run: |
rm -rf build && CC=icc CXX=icpc cmake -DCMAKE_BUILD_TYPE=COMPAT_GLIBC -B build && cmake --build build -j8
dpkg --add-architecture i386
apt-get update
apt-get install -y \
gcc-multilib g++-multilib \
build-essential \
libc6-dev libc6-dev-i386 \
git cmake rsync \
g++ gcc
- name: Build using Intel GCC Compiler
run: |
rm -rf build && cmake -DCMAKE_BUILD_TYPE=COMPAT_GLIBC -B build && cmake --build build -j8
- name: Prepare SDK
run: |
Expand Down Expand Up @@ -98,30 +109,25 @@ jobs:
shell: bash

- name: Deploy artifacts
uses: actions/upload-artifact@v3.1.1
uses: actions/upload-artifact@v4
id: upload-job
with:
name: linux32
path: publish/*

- name: Cleanup temporary artifacts
if: success() && steps.upload-job.outcome == 'success'
run: |
rm -f appversion.h
publish:
name: 'Publish'
runs-on: ubuntu-latest
needs: [windows, linux]

steps:
- name: Deploying linux artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: linux32

- name: Deploying windows artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: win32

Expand Down Expand Up @@ -149,17 +155,11 @@ jobs:
7z a -tzip metamod-bin-${{ env.APP_VERSION }}.zip addons/ example_plugin/ sdk/
- name: Publish artifacts
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
id: publish-job
if: |
startsWith(github.ref, 'refs/tags/') &&
steps.packaging-job.outcome == 'success'
with:
files: |
*.zip
- name: Cleanup temporary artifacts
if: success() && steps.publish-job.outcome == 'success'
run: |
rm -rf addons debug example_plugin sdk
rm -f *.zip appversion.h

0 comments on commit 011e823

Please sign in to comment.