2024-01-01 15:15:19 -05:00
|
|
|
name: Main
|
2023-01-10 06:49:05 -05:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2023-01-16 13:11:45 -05:00
|
|
|
- "**"
|
2023-06-14 17:12:51 -04:00
|
|
|
tags:
|
|
|
|
- '[0-9]+.[0-9]+.[0-9]+'
|
2023-01-10 06:49:05 -05:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2023-01-16 13:11:45 -05:00
|
|
|
- "**"
|
2023-01-10 06:49:05 -05:00
|
|
|
types: [opened, synchronize, reopened]
|
2023-06-12 17:21:43 -04:00
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2023-08-11 02:54:57 -04:00
|
|
|
env:
|
|
|
|
PREMAKE_VERSION: "5.0.0-beta2"
|
|
|
|
|
2023-01-10 06:49:05 -05:00
|
|
|
jobs:
|
2023-06-25 10:48:45 -04:00
|
|
|
build-windows:
|
2023-01-10 06:49:05 -05:00
|
|
|
name: Build Windows
|
|
|
|
runs-on: windows-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-06-25 10:48:45 -04:00
|
|
|
config:
|
2023-01-10 06:49:05 -05:00
|
|
|
- release
|
|
|
|
arch:
|
|
|
|
- x86
|
|
|
|
- x64
|
|
|
|
include:
|
|
|
|
- arch: x86
|
|
|
|
platform: Win32
|
|
|
|
- arch: x64
|
|
|
|
platform: x64
|
|
|
|
steps:
|
|
|
|
- name: Check out files
|
2023-12-01 09:49:41 -05:00
|
|
|
uses: actions/checkout@v4
|
2023-01-10 06:49:05 -05:00
|
|
|
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
|
2023-01-10 06:49:05 -05:00
|
|
|
|
2023-06-12 17:21:43 -04:00
|
|
|
- name: Add premake5 to PATH
|
2023-08-11 02:54:57 -04:00
|
|
|
uses: abel0b/setup-premake@v2.3
|
2023-06-12 17:21:43 -04:00
|
|
|
with:
|
2023-08-11 02:54:57 -04:00
|
|
|
version: ${{ env.PREMAKE_VERSION }}
|
2023-06-12 17:21:43 -04:00
|
|
|
|
2023-01-10 06:49:05 -05:00
|
|
|
- name: Generate project files
|
2023-06-12 17:21:43 -04:00
|
|
|
run: premake5 vs2022
|
2023-01-10 06:49:05 -05:00
|
|
|
|
|
|
|
- name: Set up problem matching
|
|
|
|
uses: ammaraskar/msvc-problem-matcher@master
|
|
|
|
|
2023-06-25 10:48:45 -04:00
|
|
|
- name: Build ${{matrix.arch}} ${{matrix.config}} binaries
|
|
|
|
run: msbuild /m /v:minimal /p:Configuration=${{matrix.config}} /p:Platform=${{matrix.platform}} build/gsc-tool.sln
|
2023-01-10 06:49:05 -05:00
|
|
|
|
2023-06-25 10:48:45 -04:00
|
|
|
- name: Upload ${{matrix.arch}} ${{matrix.config}} binaries
|
2023-12-01 09:49:41 -05:00
|
|
|
uses: actions/upload-artifact@v3.1.3
|
2023-01-10 06:49:05 -05:00
|
|
|
with:
|
2023-06-25 10:48:45 -04:00
|
|
|
name: windows-${{matrix.arch}}-${{matrix.config}}
|
2023-01-10 06:49:05 -05:00
|
|
|
path: |
|
2023-06-25 10:48:45 -04:00
|
|
|
build/bin/${{matrix.arch}}/${{matrix.config}}/gsc-tool.exe
|
2023-01-10 06:49:05 -05:00
|
|
|
|
2023-06-25 10:48:45 -04:00
|
|
|
build-macos:
|
2023-01-10 06:49:05 -05:00
|
|
|
name: Build macOS
|
2024-02-11 12:12:26 -05:00
|
|
|
runs-on: macos-13
|
2023-01-10 06:49:05 -05:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-06-25 10:48:45 -04:00
|
|
|
config:
|
2023-01-10 06:49:05 -05:00
|
|
|
- release
|
|
|
|
arch:
|
|
|
|
- x64
|
2023-06-25 10:48:45 -04:00
|
|
|
- arm64
|
2023-01-10 06:49:05 -05:00
|
|
|
steps:
|
|
|
|
- name: Check out files
|
2023-12-01 09:49:41 -05:00
|
|
|
uses: actions/checkout@v4
|
2023-01-10 06:49:05 -05:00
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
fetch-depth: 0
|
|
|
|
lfs: false
|
|
|
|
|
2024-02-11 12:12:26 -05:00
|
|
|
- name: Set up Homebrew
|
|
|
|
uses: Homebrew/actions/setup-homebrew@master
|
|
|
|
|
|
|
|
- name: Install LLVM
|
|
|
|
run: brew install llvm
|
|
|
|
|
|
|
|
- name: Add LLVM to PATH
|
|
|
|
run: |
|
|
|
|
echo "/usr/local/opt/llvm/bin" >> $GITHUB_PATH
|
|
|
|
|
2023-06-12 17:21:43 -04:00
|
|
|
- name: Add premake5 to PATH
|
2023-08-11 02:54:57 -04:00
|
|
|
uses: abel0b/setup-premake@v2.3
|
2023-06-12 17:21:43 -04:00
|
|
|
with:
|
2023-08-11 02:54:57 -04:00
|
|
|
version: ${{ env.PREMAKE_VERSION }}
|
2023-06-12 17:21:43 -04:00
|
|
|
|
2023-01-10 06:49:05 -05:00
|
|
|
- name: Generate project files
|
2023-06-12 17:21:43 -04:00
|
|
|
run: premake5 gmake2
|
2023-01-10 06:49:05 -05:00
|
|
|
|
|
|
|
- name: Set up problem matching
|
|
|
|
uses: ammaraskar/gcc-problem-matcher@master
|
|
|
|
|
2023-06-25 10:48:45 -04:00
|
|
|
- name: Build ${{matrix.arch}} ${{matrix.config}} binaries
|
2023-01-10 06:49:05 -05:00
|
|
|
run: |
|
|
|
|
pushd build
|
2023-06-25 10:48:45 -04:00
|
|
|
make config=${{matrix.config}}_${{matrix.arch}} -j$(sysctl -n hw.logicalcpu)
|
2023-06-12 17:21:43 -04:00
|
|
|
|
2023-06-25 10:48:45 -04:00
|
|
|
- name: Upload ${{matrix.arch}} ${{matrix.config}} binaries
|
2023-12-01 09:49:41 -05:00
|
|
|
uses: actions/upload-artifact@v3.1.3
|
2023-01-10 06:49:05 -05:00
|
|
|
with:
|
2023-06-25 10:48:45 -04:00
|
|
|
name: macos-${{matrix.arch}}-${{matrix.config}}
|
2023-01-10 06:49:05 -05:00
|
|
|
path: |
|
2023-06-25 10:48:45 -04:00
|
|
|
build/bin/${{matrix.arch}}/${{matrix.config}}/gsc-tool
|
2023-02-27 17:14:27 -05:00
|
|
|
|
2023-06-25 10:48:45 -04:00
|
|
|
build-linux:
|
2023-02-27 17:14:27 -05:00
|
|
|
name: Build Linux
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-06-25 10:48:45 -04:00
|
|
|
config:
|
2023-02-27 17:14:27 -05:00
|
|
|
- release
|
|
|
|
arch:
|
|
|
|
- x64
|
2024-02-11 12:12:26 -05:00
|
|
|
# - arm64
|
2023-02-27 17:14:27 -05:00
|
|
|
steps:
|
|
|
|
- name: Check out files
|
2023-12-01 09:49:41 -05:00
|
|
|
uses: actions/checkout@v4
|
2023-02-27 17:14:27 -05:00
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
fetch-depth: 0
|
|
|
|
lfs: false
|
2023-06-12 17:21:43 -04:00
|
|
|
|
2024-02-11 12:12:26 -05:00
|
|
|
- name: Install LLVM
|
2023-06-29 16:11:49 -04:00
|
|
|
run: |
|
2024-02-11 12:12:26 -05:00
|
|
|
wget https://apt.llvm.org/llvm.sh
|
|
|
|
chmod +x llvm.sh
|
|
|
|
sudo ./llvm.sh 17
|
|
|
|
|
|
|
|
# - name: Install dependencies (arm64)
|
|
|
|
# if: matrix.arch == 'arm64'
|
|
|
|
# run: sudo apt-get install crossbuild-essential-arm64 -y
|
2023-06-12 17:21:43 -04:00
|
|
|
|
|
|
|
- name: Add premake5 to PATH
|
2023-08-11 02:54:57 -04:00
|
|
|
uses: abel0b/setup-premake@v2.3
|
2023-06-12 17:21:43 -04:00
|
|
|
with:
|
2023-08-11 02:54:57 -04:00
|
|
|
version: ${{ env.PREMAKE_VERSION }}
|
2023-06-12 17:21:43 -04:00
|
|
|
|
2023-02-27 17:14:27 -05:00
|
|
|
- name: Generate project files
|
2023-06-12 17:21:43 -04:00
|
|
|
run: premake5 gmake2
|
2023-02-27 17:14:27 -05:00
|
|
|
|
|
|
|
- name: Set up problem matching
|
|
|
|
uses: ammaraskar/gcc-problem-matcher@master
|
|
|
|
|
2023-06-25 10:48:45 -04:00
|
|
|
- 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:
|
2024-02-11 12:12:26 -05:00
|
|
|
CC: clang-17
|
|
|
|
CXX: clang++-17
|
2023-02-27 17:14:27 -05:00
|
|
|
|
2023-06-25 10:48:45 -04:00
|
|
|
- name: Upload ${{matrix.arch}} ${{matrix.config}} binaries
|
2023-12-01 09:49:41 -05:00
|
|
|
uses: actions/upload-artifact@v3.1.3
|
2023-02-27 17:14:27 -05:00
|
|
|
with:
|
2023-06-25 10:48:45 -04:00
|
|
|
name: linux-${{matrix.arch}}-${{matrix.config}}
|
2023-02-27 17:14:27 -05:00
|
|
|
path: |
|
2023-06-25 10:48:45 -04:00
|
|
|
build/bin/${{matrix.arch}}/${{matrix.config}}/gsc-tool
|
2023-06-14 17:12:51 -04:00
|
|
|
|
|
|
|
deploy:
|
|
|
|
name: Deploy Release
|
|
|
|
runs-on: ubuntu-latest
|
2023-06-25 10:48:45 -04:00
|
|
|
needs: [ build-windows, build-macos, build-linux ]
|
2024-01-05 14:06:56 -05:00
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
2023-06-14 17:12:51 -04:00
|
|
|
steps:
|
2024-01-05 14:44:59 -05:00
|
|
|
- name: Checkout Source
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
sparse-checkout: |
|
|
|
|
Dockerfile
|
|
|
|
sparse-checkout-cone-mode: false
|
|
|
|
|
2023-06-14 17:12:51 -04:00
|
|
|
- name: Download Binaries
|
2024-01-01 15:15:19 -05:00
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
|
|
|
|
- name: Compress Binaries
|
|
|
|
run: |
|
|
|
|
for dir in */; do
|
|
|
|
if [[ $dir == *"windows"* ]]; then
|
2024-01-06 07:46:18 -05:00
|
|
|
cd "$dir" && zip -r "../${dir%/}.zip" . && cd ..
|
2024-01-01 15:15:19 -05:00
|
|
|
else
|
2024-01-06 07:08:41 -05:00
|
|
|
tar -czvf "${dir%/}.tar.gz" -C "$dir" .
|
2024-01-01 15:15:19 -05:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
shell: bash
|
2023-06-14 17:12:51 -04:00
|
|
|
|
|
|
|
- name: Create Release
|
|
|
|
uses: "marvinpinto/action-automatic-releases@latest"
|
|
|
|
with:
|
|
|
|
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
prerelease: false
|
|
|
|
draft: true
|
|
|
|
files: |
|
2024-01-01 15:15:19 -05:00
|
|
|
*.zip
|
|
|
|
*.tar.gz
|
|
|
|
|
|
|
|
- name: Build and Publish Docker Image
|
|
|
|
uses: VaultVulp/gp-docker-action@1.6.0
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
image-name: gsc-tool
|
|
|
|
extract-git-tag: true
|
|
|
|
additional-image-tags: latest
|