Skip to content

Commit

Permalink
gh actions: use new build script for mingw
Browse files Browse the repository at this point in the history
  • Loading branch information
Chilledheart committed May 18, 2024
1 parent e93da5e commit adb9b11
Showing 1 changed file with 17 additions and 36 deletions.
53 changes: 17 additions & 36 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,24 @@ jobs:
run: |
move build\GenshinImpactLoader.exe build\GenshinImpactLoaderClangCl.exe
gh release upload ${{ github.event.release.tag_name }} build\GenshinImpactLoaderClangCl.exe
windows-mingw64-release:
runs-on: windows-2019
mingw64-release:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
arch:
- name: i686
output: x86
mingw_dir: mingw32
- name: x86_64
output: x64
mingw_dir: mingw64
- name: aarch64
output: arm64
build_type: [Debug, Release]
defaults:
run:
shell: cmd
shell: bash
env:
BUILD_TYPE: '${{ matrix.build_type }}'
steps:
- uses: actions/checkout@v4
- name: Checkout with shallow submodules
Expand All @@ -125,43 +127,22 @@ jobs:
git submodule update --init --depth 1
- name: Cache mingw64 toolchain
id: mingw64-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
mingw64
mingw32
key: mingw64-${{ matrix.arch.name }}-toolchain
- name: "Download dependency: mingw64"
if: ${{ steps.mingw64-cache.outputs.cache-hit != 'true' }}
run: |
scripts\download-mingw.bat ${{ matrix.arch.name }}
- name: Build
third_party/llvm-mingw-20231128-ucrt-ubuntu-20.04-x86_64
key: mingw64-${{ matrix.arch.name }}-toolchain-ubuntu-20231128
- name: Populate depedencies
run: |
set CC=gcc
set CXX=g++
set MINGWDIR=${{ matrix.arch.mingw_dir }}
set "Path=%CD%\%MINGWDIR%\bin;%Path%"
REM start to build with workaround
mkdir build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
ninja
- name: Packaging
sudo apt-get update -qq
sudo apt-get install -y cmake ninja-build
- name: Build and Packaging
run: |
set MINGWDIR=${{ matrix.arch.mingw_dir }}
set "Path=%CD%\%MINGWDIR%\bin;%Path%"
cd build
objcopy --only-keep-debug GenshinImpactLoader.exe GenshinImpactLoader.exe.dbg
# stripped executable.
objcopy --strip-debug GenshinImpactLoader.exe
# to add a link to the debugging info into the stripped executable.
objcopy --add-gnu-debuglink=GenshinImpactLoader.exe.dbg GenshinImpactLoader.exe
./scripts/build.sh
- name: Upload dist tarball
if: ${{ github.event_name == 'release' && matrix.build_type == 'Release' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
move build\GenshinImpactLoader.exe build\GenshinImpactLoaderMingw_${{ matrix.arch.output }}.exe
gh release upload ${{ github.event.release.tag_name }} build\GenshinImpactLoaderMingw_${{ matrix.arch.output }}.exe
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

0 comments on commit adb9b11

Please sign in to comment.