From 01fef6b6bfc7e5d084a072fc9e4f8c69a1226731 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Thu, 14 Sep 2023 21:13:01 +0800 Subject: [PATCH] Add windows workflow --- .github/workflows/c-cpp.yml | 29 ------------------- .github/workflows/windows.yml | 53 +++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 29 deletions(-) delete mode 100644 .github/workflows/c-cpp.yml create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml deleted file mode 100644 index 040a35c..0000000 --- a/.github/workflows/c-cpp.yml +++ /dev/null @@ -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 - diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..50175c7 --- /dev/null +++ b/.github/workflows/windows.yml @@ -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 }}