Skip to content

Add macos artifact uploading #3536

Add macos artifact uploading

Add macos artifact uploading #3536

name: Continuous Integration
on: [push, pull_request]
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
defaults:
run:
shell: ${{ matrix.config.shell }}
strategy:
fail-fast: false
matrix:
config:
- name: "MSVC x64"
+ os: windows-latest,
+ build_type: "Release"
+ vcpkg_triplet: x64-windows
+ shell: pwsh,
+ extra_options: >-
+ -A x64

Check failure on line 25 in .github/workflows/continuous_integration.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/continuous_integration.yml

Invalid workflow file

You have an error in your yaml syntax on line 25
+ -DCMAKE_TOOLCHAIN_FILE="${env:VCPKG_INSTALLATION_ROOT}\scripts\buildsystems\vcpkg.cmake"
+ -DVCPKG_TARGET_TRIPLET=x64-windows
+
+ - name: "MSYS2 UCRT64"
+ os: windows-latest
+ build_type: "Release"
+ extra_options: "-G Ninja"
+ package_name: "mingw_x64"
+ shell: "msys2 {0}"
+ msystem: ucrt64
+ msys-env: mingw-w64-ucrt-x86_64
+ artifact-path: build/*.zip
+
+ - name: "Linux GCC"
+ os: ubuntu-latest
+ build_type: "Release"
+ extra_options: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr"
+ package_name: "linux_gcc"
+ shell: bash
+ artifact-path: build/*.appimage
+
+ - name: "macOS arm64 Clang"
+ os: macos-latest
+ build_type: "Release"
+ extra_options: "-G Ninja"
+ package_name: "mac_arm64"
+ shell: bash
+ artifact-path: build/*.zip
+
+ - name: "macOS x64 Clang"
+ os: macos-13
+ build_type: "Release"
+ extra_options: "-G Ninja"
+ package_name: "mac_x64"
+ shell: bash
+ artifact-path: build/*.zip
steps:
- uses: actions/checkout@v4
- name: Install Dependencies (MSYS2)
if: matrix.config.shell == 'msys2 {0}'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.config.msystem }}
install: >-
${{ matrix.config.msys-env }}-gcc
${{ matrix.config.msys-env }}-cmake
${{ matrix.config.msys-env }}-ninja
${{ matrix.config.msys-env }}-pkgconf
${{ matrix.config.msys-env }}-dumb
${{ matrix.config.msys-env }}-fluidsynth
${{ matrix.config.msys-env }}-libmad
${{ matrix.config.msys-env }}-libvorbis
${{ matrix.config.msys-env }}-portmidi
${{ matrix.config.msys-env }}-SDL2
${{ matrix.config.msys-env }}-SDL2_image
${{ matrix.config.msys-env }}-SDL2_mixer
${{ matrix.config.msys-env }}-libzip
- name: Export GitHub Actions cache environment variables
if: ${{ matrix.config.vcpkg_triplet }}
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install Dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y \
gcc \
cmake \
ninja-build \
pkg-config \
libdumb1-dev \
libfluidsynth-dev \
libmad0-dev \
libportmidi-dev \
libsdl2-dev \
libsdl2-image-dev \
libsdl2-mixer-dev \
libvorbis-dev \
libzip-dev \
zipcmp \
zipmerge \
ziptool
- name: Install Dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew update
brew install --overwrite python@3.12
env HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 \
brew install \
cmake \
ninja \
pkg-config \
dumb \
fluid-synth \
libvorbis \
libzip \
mad \
portmidi \
sdl2 \
sdl2_image \
sdl2_mixer \
dylibbundler
- name: Configure
run: >-
cmake -S prboom2
-B build
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }}
${{ matrix.config.extra_options }}
- name: Build
run: cmake --build build --config ${{ matrix.config.build_type }}
- name: Package
if: ${{ matrix.config.package_name }}
run: |
cd build
cpack
- name: Upload Artifacts
if: ${{ matrix.config.package_name }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.package_name }}
path: ${{ matrix.config.artifact-path }}
- name: Release
if: ${{ contains(github.ref, 'tags') && matrix.config.package_name }}
uses: ncipollo/release-action@v1
with:
name: ${{ github.ref_name }}
allowUpdates: true
artifacts: ${{ matrix.config.artifact-path }}