Add windows workflow

This commit is contained in:
Aoran Zeng 2023-09-14 21:13:01 +08:00
parent 5f729f7989
commit 01fef6b6bf
2 changed files with 53 additions and 29 deletions

View File

@ -1,29 +0,0 @@
name: C/C++ CI
on:
push:
branches: [ "gh-pipeline" ]
pull_request:
branches: [ "gh-pipeline" ]
jobs:
build:
runs-on: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- name: make
run: make
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.3
with:
# Artifact name
name: chsrc
path: chsrc
# The desired behavior if no files are found using the provided path.
warn: Output a warning but do not fail the action
error: Fail the action with an error message

53
.github/workflows/windows.yml vendored Normal file
View File

@ -0,0 +1,53 @@
name: Windows Build
on:
push:
branches: [ "gh-pipeline" ]
pull_request:
branches: [ "gh-pipeline" ]
jobs:
build-and-upload:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install x64 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: Compile chsrc x64
run: |
mingw32-make.exe CI BUILD_NAME=chsrc-x64-windows
- name: Compile chsrc x86
env:
MSYSTEM: MINGW32
run: |
mingw32-make.exe CI BUILD_NAME=chsrc-x86-windows
- name: List files
run: ls *.exe
- name: Release
uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: preview
files: |
chsrc-x64-windows.exe
chsrc-x86-windows.exe
token: ${{ secrets.CHSRC_UPLOAD }}