Skip to content

Commit

Permalink
ci add windows 2019 [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
wxyzh committed Apr 1, 2024
1 parent d91e55d commit f4d8d61
Showing 1 changed file with 7 additions and 77 deletions.
84 changes: 7 additions & 77 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ on:

jobs:
build:
runs-on: windows-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2022, windows-2019]
compiler: [msvc, clang]
arch: [x64]
include:
Expand Down Expand Up @@ -105,7 +106,7 @@ jobs:
include
lib
share
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.arch }}-${{ hashFiles('submodule-status') }}
key: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.arch }}-${{ hashFiles('submodule-status') }}

- name: Build dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
Expand All @@ -119,87 +120,16 @@ jobs:

- name: Create distributable
run: |
7z a rime-${{ env.git_ref_name }}-${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.arch }}.7z `
7z a rime-${{ env.git_ref_name }}-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.arch }}.7z `
dist version-info.txt
7z a -x'!*/.placeholder' rime-deps-${{ env.git_ref_name }}-${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.arch }}.7z `
7z a -x'!*/.placeholder' rime-deps-${{ env.git_ref_name }}-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.arch }}.7z `
bin include lib share build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifact-${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.arch }}
name: artifact-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.arch }}
path: |
rime-${{ env.git_ref_name }}-${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.arch }}.7z
rime-${{ env.git_ref_name }}-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.arch }}.7z
rime-deps-${{ env.git_ref_name }}-${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.arch }}.7z
build-mingw:
runs-on: windows-latest
env:
RIME_PLUGINS: ${{ inputs.rime_plugins }}
defaults:
run:
shell: msys2 {0}

steps:
- name: Install dependencies with MSYS2
uses: msys2/setup-msys2@v2
with:
release: false
update: true
msystem: UCRT64
install: >-
git
base-devel
mingw-w64-ucrt-x86_64-boost
mingw-w64-ucrt-x86_64-glog
mingw-w64-ucrt-x86_64-gtest
mingw-w64-ucrt-x86_64-yaml-cpp
mingw-w64-ucrt-x86_64-leveldb
mingw-w64-ucrt-x86_64-marisa
mingw-w64-ucrt-x86_64-opencc
pacboy: >-
toolchain:p
cmake:p
ninja:p
- run: git config --global core.autocrlf input
- name: Checkout last commit
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}

- name: Configure build environment
run: |
echo git_ref_name="$(git describe --always)" >> $GITHUB_ENV
- name: Install Rime plugins
run: ./action-install-plugins-macos.sh

- name: Build with mingw-w64
run: |
cmake -B build -G Ninja \
-DCMAKE_INSTALL_PREFIX:PATH=`pwd`/dist \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DENABLE_LOGGING:BOOL=ON \
-DBUILD_TEST:BOOL=ON \
-DBUILD_STATIC:BOOL=ON \
-DBUILD_SHARED_LIBS:BOOL=ON
cmake --build build
cmake --install build
cd build && cp ./bin/librime.dll ./test
ctest --output-on-failure
- name: Create distributable
run: |
tar -cjvf rime-${{ env.git_ref_name }}-${{ runner.os }}-mingw.tar.bz2 \
dist version-info.txt
tar -cjvf rime-deps-${{ env.git_ref_name }}-${{ runner.os }}-mingw.tar.bz2 \
--exclude '*/.placeholder' \
bin include lib share build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifact-${{ runner.os }}-mingw
path: |
rime-${{ env.git_ref_name }}-${{ runner.os }}-mingw.tar.bz2

0 comments on commit f4d8d61

Please sign in to comment.