gsc-tool/.github/workflows/build.yml

178 lines
4.5 KiB
YAML
Raw Normal View History

name: Build
on:
push:
branches:
2023-01-16 13:11:45 -05:00
- "**"
tags:
- '[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches:
2023-01-16 13:11:45 -05:00
- "**"
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build-windows:
name: Build Windows
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
config:
- release
arch:
- x86
- x64
include:
- arch: x86
platform: Win32
- arch: x64
platform: x64
steps:
- name: Check out files
uses: actions/checkout@v3.5.3
with:
submodules: true
fetch-depth: 0
lfs: false
- name: Add msbuild to PATH
2023-02-27 17:14:27 -05:00
uses: microsoft/setup-msbuild@v1.3.1
- name: Add premake5 to PATH
uses: abel0b/setup-premake@v2.2
with:
version: "5.0.0-beta2"
- name: Generate project files
run: premake5 vs2022
- name: Set up problem matching
uses: ammaraskar/msvc-problem-matcher@master
- name: Build ${{matrix.arch}} ${{matrix.config}} binaries
run: msbuild /m /v:minimal /p:Configuration=${{matrix.config}} /p:Platform=${{matrix.platform}} build/gsc-tool.sln
- name: Upload ${{matrix.arch}} ${{matrix.config}} binaries
2023-02-27 17:14:27 -05:00
uses: actions/upload-artifact@v3.1.2
with:
name: windows-${{matrix.arch}}-${{matrix.config}}
path: |
build/bin/${{matrix.arch}}/${{matrix.config}}/gsc-tool.exe
build-macos:
name: Build macOS
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
config:
- release
arch:
- x64
- arm64
steps:
- name: Check out files
uses: actions/checkout@v3.5.3
with:
submodules: true
fetch-depth: 0
lfs: false
- name: Add premake5 to PATH
uses: abel0b/setup-premake@v2.2
with:
version: "5.0.0-beta2"
- name: Generate project files
run: premake5 gmake2
- name: Set up problem matching
uses: ammaraskar/gcc-problem-matcher@master
- name: Build ${{matrix.arch}} ${{matrix.config}} binaries
run: |
pushd build
make config=${{matrix.config}}_${{matrix.arch}} -j$(sysctl -n hw.logicalcpu)
- name: Upload ${{matrix.arch}} ${{matrix.config}} binaries
2023-02-27 17:14:27 -05:00
uses: actions/upload-artifact@v3.1.2
with:
name: macos-${{matrix.arch}}-${{matrix.config}}
path: |
build/bin/${{matrix.arch}}/${{matrix.config}}/gsc-tool
2023-02-27 17:14:27 -05:00
build-linux:
2023-02-27 17:14:27 -05:00
name: Build Linux
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
2023-02-27 17:14:27 -05:00
- release
arch:
- x64
steps:
- name: Check out files
uses: actions/checkout@v3.5.3
2023-02-27 17:14:27 -05:00
with:
submodules: true
fetch-depth: 0
lfs: false
- name: Add mold to PATH
uses: rui314/setup-mold@staging
- name: Add premake5 to PATH
uses: abel0b/setup-premake@v2.2
with:
version: "5.0.0-beta2"
2023-02-27 17:14:27 -05:00
- name: Generate project files
run: premake5 gmake2
2023-02-27 17:14:27 -05:00
- name: Set up problem matching
uses: ammaraskar/gcc-problem-matcher@master
- name: Build ${{matrix.arch}} ${{matrix.config}} binaries
2023-02-27 17:14:27 -05:00
run: |
pushd build
make config=${{matrix.config}}_${{matrix.arch}} -j$(nproc)
env:
CC: clang
CXX: clang++
- name: Upload ${{matrix.arch}} ${{matrix.config}} binaries
2023-02-27 17:14:27 -05:00
uses: actions/upload-artifact@v3.1.2
with:
name: linux-${{matrix.arch}}-${{matrix.config}}
2023-02-27 17:14:27 -05:00
path: |
build/bin/${{matrix.arch}}/${{matrix.config}}/gsc-tool
deploy:
name: Deploy Release
runs-on: ubuntu-latest
needs: [ build-windows, build-macos, build-linux ]
2023-06-14 18:02:48 -04:00
if: startsWith(github.ref, 'refs/tags/') && (github.event.base_ref == 'refs/heads/prod' || github.event.base_ref == 'refs/heads/dev')
steps:
- name: Check out files
uses: actions/checkout@v3.5.3
- name: Download Binaries
uses: actions/download-artifact@v3.0.2
with:
name: windows-x64-release
- name: Create Release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
draft: true
files: |
gsc-tool.exe