chsrc/.github/workflows/build-on-Windows.yml
Aoran Zeng 02c3a815de
Workflows use zh
[skip ci]
2025-06-16 16:34:10 +08:00

64 lines
1.5 KiB
YAML

# ---------------------------------------------------------------
# Workflow File : build-on-Windows.yml
# File Authors : Aoran Zeng <ccmywish@qq.com>
# Contributors : Nul None <nul@none.org>
# |
# Created On : <2023-09-14>
# Last Modified : <2025-06-16>
#
# Build chsrc on Windows and upload it to GitHub: the 'pre' release
# ---------------------------------------------------------------
name: 构建于 Windows
on:
push:
branches: [ "gh-build" ]
pull_request:
branches: [ "gh-build" ]
jobs:
build-and-upload:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: 检出代码
uses: actions/checkout@v4
- name: 安装 GCC
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: |
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-make
mingw-w64-i686-gcc
mingw-w64-i686-make
- name: 为 x64 构建
run: |
mingw32-make.exe CI CI_ARTIFACT_NAME=chsrc-x64-windows
- name: 为 x32 构建
env:
MSYSTEM: MINGW32
run: |
mingw32-make.exe CI CI_ARTIFACT_NAME=chsrc-x86-windows
- name: List files
run: ls *.exe
- name: 上传至 'pre' release
uses: softprops/action-gh-release@v2
# if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: pre
files: |
chsrc-x64-windows.exe
chsrc-x86-windows.exe
token: ${{ secrets.UPLOAD_TO_GITHUB }}