Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为allMagicNB合并版本的构建文件重新添加注释 #4025

Closed
wants to merge 15 commits into from
45 changes: 36 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,74 @@
name: Build
# 定义工作流名称
name: 编译 PCL

# 定义触发器
on:
# 提交内容修改代码或编辑工作流时
push:
paths:
- 'Plain Craft Launcher 2/**'
- '.github/workflows/**'
# 新的PR修改代码或编辑工作流时
pull_request:
paths:
- 'Plain Craft Launcher 2/**'
- '.github/workflows/**'
# 手动触发时
workflow_dispatch:
Silverteal marked this conversation as resolved.
Show resolved Hide resolved

# 定义工作列表
jobs:
# 唯一的工作:build

build:

strategy:
strategy:
# 定义矩阵,矩阵中每组都会单独执行,并使矩阵本身成为可用的上下文
matrix:
# 五个编译选项
configuration: [Debug, Release, Snapshot, BETA, ReleaseUpdate]

# 显然,只有Windows才能构建.NET Framework程序
runs-on: windows-latest

# 定义步骤列表
steps:
- name: Checkout

- name: 签出仓库
# 调用actions/checkout仓库的调用预设工作流
uses: actions/checkout@v4
# 调用参数
with:
# 只签出第一层
fetch-depth: 0

- name: Set Describe
- name: 导出提交描述
shell: bash
run: |
Describe=`git describe --tags`
echo "Describe=$Describe" >> $GITHUB_ENV
continue-on-error: true

# 在极少数情况下,可能没有可用的提交描述。详见 https://github.com/Silverteal/PCL2/actions/runs/9518525229/job/26239628548
- name: 导出备用描述
shell: bash
run: |
echo "Describe=unknown" >> $GITHUB_ENV
if: ${{ failure() }}

- name: Setup MSBuild.exe
- name: 配置 MSBuild
uses: microsoft/setup-msbuild@v2
with:
# 生成工具使用64位架构
msbuild-architecture: x64

- name: Build
- name: 编译源代码
run: msbuild "Plain Craft Launcher 2\Plain Craft Launcher 2.vbproj" -p:Configuration=${{ matrix.configuration }}

- name: Upload a Build Artifact
- name: 打包并上传编译产物
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.configuration }} ${{ env.Describe }}
# 文件名格式示例:pcl2-autobuild-2.7.4-37-a0b1c2d3-Snapshot.zip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我还是那句话,你要不要先看看再说?

# 其中2.7.4是仓库最新tag,37是自上一个标签的提交数,a0b1c2d3是最后一次提交哈希
Silverteal marked this conversation as resolved.
Show resolved Hide resolved
name: pcl2-autobuild-${{ env.Describe }}-${{ matrix.configuration }}
path: Plain Craft Launcher 2\obj\${{ matrix.configuration }}\Plain Craft Launcher 2.exe