Skip to content

重构 HMCLauncher

重构 HMCLauncher #15

name: Build HMCLauncher (Using CMake and gcc)
on:
push:
paths:
- 'HMCLauncher/**'
- '.github/workflows/build-launcher(cmake-gcc).yml'
pull_request:
paths:
- 'HMCLauncher/**'
- '.github/workflows/build-launcher(cmake-gcc).yml'
jobs:
build:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: 'Setup MSYS2'
uses: msys2/setup-msys2@v2
with:
msystem: mingw32
update: true
install: >-
mingw-w64-i686-toolchain
mingw-w64-i686-ninja
mingw-w64-i686-cmake
git
- name: 'Checkout'
uses: actions/checkout@v4
- name: Build HMCLauncher
run: |
cmake -S ./HMCLauncher/HMCL -B ./HMCLauncher/HMCL/build -DCMAKE_BUILD_TYPE=Release
cmake --build ./HMCLauncher/HMCL/build
- name: Copy HMCLauncher to assets
run: cp ./HMCLauncher/HMCL/build/HMCLauncher.exe ./HMCL/src/main/resources/assets/HMCLauncher.exe
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
java-package: 'jdk+fx'
- name: Build with Gradle
run: ./gradlew makeExecutables --no-daemon
env:
MICROSOFT_AUTH_ID: ${{ secrets.MICROSOFT_AUTH_ID }}
MICROSOFT_AUTH_SECRET: ${{ secrets.MICROSOFT_AUTH_SECRET }}
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
- name: Get short SHA
uses: benjlevesque/[email protected]
with:
length: 7
- name: Copy HMCLauncher to libs
run: cp ./HMCLauncher/HMCL/build/HMCLauncher.exe ./HMCL/build/libs/HMCLauncher.exe
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: HMCLauncher-${{ env.SHA }}
path: HMCL/build/libs/*.exe