mingw: don't require c++ runtime #121
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
type: choice | |
options: | |
- info | |
- warning | |
- debug | |
tags: | |
description: 'Test scenario tags' | |
required: false | |
type: boolean | |
pull_request: | |
push: | |
branches: [master] | |
paths-ignore: [README.md] | |
release: | |
types: [published] | |
defaults: | |
run: | |
shell: cmd | |
jobs: | |
windows-release: | |
runs-on: windows-2019 | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: | |
- name: x64 | |
host_arch: amd64 | |
- name: x86 | |
host_arch: x86 | |
build_type: [Debug, MinSizeRel] | |
env: | |
BUILD_TYPE: '${{ matrix.build_type }}' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Checkout with shallow submodules | |
run: | | |
# unshallow must come first otherwise submodule may be get unshallowed | |
git fetch --tags --unshallow | |
git submodule update --init --depth 1 | |
- name: Build | |
run: | | |
set VCToolsVersion=14.29 | |
set Winsdk=10.0.19041.0 | |
set "WindowsSDKVersion=%Winsdk%\" | |
set vsdevcmd=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat | |
set "VSCMD_START_DIR=%CD%" | |
call "%vsdevcmd%" -arch=${{ matrix.arch.name }} -host_arch=${{ matrix.arch.host_arch }} -winsdk=%Winsdk% -no_logo -vcvars_ver=%VCToolsVersion% | |
mkdir build | |
cd build && cmake -G Ninja -DCMAKE_BUILD_TYPE=%BUILD_TYPE% .. && ninja|| exit /b | |
- name: Upload dist | |
if: ${{ github.event_name == 'release' && matrix.build_type == 'MinSizeRel' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
move build\GenshinImpactLoader.exe build\GenshinImpactLoader_${{ matrix.arch.name }}.exe | |
gh release upload ${{ github.event.release.tag_name }} build\GenshinImpactLoader_${{ matrix.arch.name }}.exe | |
windows-clang-cl-release: | |
runs-on: windows-2019 | |
strategy: | |
fail-fast: false | |
matrix: | |
build_type: [Debug, MinSizeRel] | |
env: | |
BUILD_TYPE: '${{ matrix.build_type }}' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Checkout with shallow submodules | |
run: | | |
# unshallow must come first otherwise submodule may be get unshallowed | |
git fetch --tags --unshallow | |
git submodule update --init --depth 1 | |
- name: Build | |
run: | | |
set VCToolsVersion=14.29 | |
set Winsdk=10.0.19041.0 | |
set "WindowsSDKVersion=%Winsdk%\" | |
set vsdevcmd=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat | |
set "VSCMD_START_DIR=%CD%" | |
set CC=clang-cl | |
set CXX=clang-cl | |
call "%vsdevcmd%" -arch=x64 -host_arch=amd64 -winsdk=%Winsdk% -no_logo -vcvars_ver=%VCToolsVersion% | |
mkdir build | |
cd build && cmake -G Ninja -DCMAKE_BUILD_TYPE=%BUILD_TYPE% .. && ninja|| exit /b | |
- name: Upload dist | |
if: ${{ github.event_name == 'release' && matrix.build_type == 'MinSizeRel' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
move build\GenshinImpactLoader.exe build\GenshinImpactLoaderClangCl.exe | |
gh release upload ${{ github.event.release.tag_name }} build\GenshinImpactLoaderClangCl.exe | |
mingw64-release: | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: | |
- name: i686 | |
output: x86 | |
- name: x86_64 | |
output: x64 | |
- name: aarch64 | |
output: arm64 | |
build_type: [Debug, MinSizeRel] | |
defaults: | |
run: | |
shell: bash | |
env: | |
BUILD_TYPE: '${{ matrix.build_type }}' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Checkout with shallow submodules | |
run: | | |
# unshallow must come first otherwise submodule may be get unshallowed | |
git fetch --tags --unshallow | |
git submodule update --init --depth 1 | |
- name: Cache mingw64 toolchain | |
id: mingw64-cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
third_party/llvm-mingw-20240518-ucrt-ubuntu-20.04-x86_64 | |
key: mingw64-${{ matrix.arch.name }}-toolchain-ubuntu-20240518 | |
- name: Populate depedencies | |
run: | | |
sudo apt-get update -qq | |
sudo apt-get install -y cmake ninja-build | |
- name: Build and Packaging | |
run: | | |
./scripts/build.sh | |
- name: Upload dist tarball | |
if: ${{ github.event_name == 'release' && matrix.build_type == 'MinSizeRel' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
mv -f build/GenshinImpactLoader.exe build/GenshinImpactLoaderMingw_${{ matrix.arch.output }}.exe | |
gh release upload ${{ github.event.release.tag_name }} build/GenshinImpactLoaderMingw_${{ matrix.arch.output }}.exe |