Skip to content

CI: Merge artifacts #96

CI: Merge artifacts

CI: Merge artifacts #96

Workflow file for this run

name: CI
on:
push:
pull_request:
workflow_dispatch:
# Run GitHub Actions monthly to make sure CI isn't broken and downloads don't expire
schedule:
- cron: '0 0 1 * *'
jobs:
build:
strategy:
matrix:
os:
- runs-on: windows-2022
suffix: ci-windows
- runs-on: ubuntu-22.04
suffix: ci-linux
# The type of runner that the job will run on
runs-on: ${{ matrix.os.runs-on }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3.3.0
with:
submodules: recursive
fetch-depth: 0 # Required for automatic versioning
- name: Install Ubuntu packages
if: matrix.os.runs-on == 'ubuntu-22.04'
run: |
sudo dpkg --add-architecture i386
sudo apt update || true
sudo apt install -y libc6:i386 linux-libc-dev:i386 ninja-build gcc-multilib g++-multilib
- name: Build release
id: build
run: |
cmake --preset github-actions
cmake --build --preset github-actions
cmake --install ${{github.workspace}}/_build/github-actions --config RelWithDebInfo --prefix ${{github.workspace}}/_build/ci-install
# Prepare artifact
- name: Prepare artifact
id: prepare_artifact
run: >
python scripts/package_target.py
--build-dir ${{github.workspace}}/_build/github-actions
--install-dir ${{github.workspace}}/_build/ci-install
--artifact-dir ${{github.workspace}}/_build/ci-artifact
--suffix ${{ matrix.os.suffix }}
# Upload result
- name: Upload build result
uses: actions/upload-artifact@v4
with:
name: ${{ steps.prepare_artifact.outputs.artifact_name }}
path: ${{github.workspace}}/_build/ci-artifact
merge-artifacts:
name: "Merge Artifacts"
needs: build
runs-on: ubuntu-latest
env:
# Must also be updated in src/game/server/CMakeLists.txt
AMXX_OFFSET_GENERATOR_VERSION: "1.0.1"
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
submodules: false # Only need scripts folder
# Download artifacts
- uses: actions/download-artifact@v4
with:
path: ${{github.workspace}}/_build/ci-artifacts
pattern: "*-ci-*"
merge-multiple: true
# Merge them
- name: Merge artifacts
id: merge_artifacts
run: >
python scripts/merge_artifacts.py
--artifact-dir ${{github.workspace}}/_build/ci-artifacts
--out-dir ${{github.workspace}}/_build/ci-out-artifact
ci-linux
ci-windows
# Upload merged artifact
- name: Upload merged artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.merge_artifacts.outputs.artifact_name }}
path: ${{github.workspace}}/_build/ci-out-artifact