使用 GitHub Action 构建 HMCLauncher (#2890)

* 使用 GitHub Action 构建 HMCLauncher

* test

* update

* update

* update

* update
This commit is contained in:
Glavo
2024-03-05 04:59:30 +08:00
committed by GitHub
parent e2355ca2ff
commit 404bc88ec8
2 changed files with 30 additions and 6 deletions

30
.github/workflows/build-launcher.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Build HMCLauncher
on:
push:
paths:
- 'HMCLauncher/**'
- '.github/workflows/build-launcher.yml'
pull_request:
paths:
- 'HMCLauncher/**'
- '.github/workflows/build-launcher.yml'
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x86
- name: Build HMCLauncher
run: msbuild /p:Configuration=Release /t:Rebuild /verbosity:detailed .\HMCLauncher\
- name: Get short SHA
run: echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 7))" >> $env:GITHUB_ENV
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: HMCLauncher-${{ env.SHORT_SHA }}
path: HMCLauncher/Release/HMCLauncher.exe