Skip to content

Commit

Permalink
chore: simplify workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
amorphobia committed Aug 29, 2024
1 parent b3bfc73 commit ffa1410
Showing 1 changed file with 17 additions and 29 deletions.
46 changes: 17 additions & 29 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,41 +98,27 @@ jobs:
name: SharedSupport
path: SharedSupport

prepare-caret-hook:
strategy:
matrix:
target: [ x86, x64 ]
name: Prepare ${{ matrix.target }} Caret Hook
runs-on: windows-latext
prepare-autohotkey-binaries:
name: Prepare AutoHotkey Binaries
runs-on: windows-latest
needs: prepare-icon
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: ${{ matrix.target }}

- name: Compile Caret Hook
run: |
Push-Location .\Lib\GetCaretPosEx\
cl /O2 /Ob1 /c /GS- /std:c++20 /d1reportSingleClassLayoutCaretPosHookData GetCaretPosFromHook.cpp
$VsPath = &(Join-Path ${env:ProgramFiles(x86)} "\Microsoft Visual Studio\Installer\vswhere.exe") -Latest -Products * -Requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -Property InstallationPath
Import-Module (Join-Path $VsPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
$targets = @("x64", "x86")
foreach ( $arch in $targets )
{
Enter-VsDevShell -VsInstallPath $VsPath -SkipAutomaticLocation -DevCmdArguments "-arch=$arch"
cl /Fo"GetCaretPosFromHook-$arch" /O2 /Ob1 /c /GS- /std:c++20 /d1reportSingleClassLayoutCaretPosHookData GetCaretPosFromHook.cpp
}
Pop-Location
Move-Item -Path .\Lib\GetCaretPosEx\GetCaretPosFromHook.obj .\GetCaretPosFromHook-${{ matrix.target }}.obj
- name: Upload Caret Hook Object
uses: actions/upload-artifact@v4
with:
name: CaretHook-${{ matrix.target }}
path: GetCaretPosFromHook-${{ matrix.target }}.obj

prepare-autohotkey-binaries:
name: Prepare AutoHotkey Binaries
runs-on: windows-latest
needs: prepare-icon
steps:
- name: Checkout
uses: actions/checkout@v4
Move-Item .\Lib\GetCaretPosEx\*.obj .\
- name: Install RcEdit
uses: MinoruSekine/setup-scoop@v4
Expand Down Expand Up @@ -162,6 +148,8 @@ jobs:
path: |
AutoHotkey32.exe
AutoHotkey64.exe
GetCaretPosFromHook-x86.obj
GetCaretPosFromHook-x64.obj
build-rabbit:
strategy:
Expand All @@ -172,7 +160,7 @@ jobs:
- { target: x64, ahk: AutoHotkey64.exe, rime: rime-x64.dll }
name: Build for ${{ matrix.target }}
runs-on: ubuntu-latest
needs: [ prepare-dependency, prepare-caret-hook, prepare-autohotkey-binaries ]
needs: [ prepare-dependency, prepare-autohotkey-binaries ]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -185,9 +173,9 @@ jobs:
- name: Copy Artifacts
run: |
cp AutoHotkey/${{ matrix.ahk }} Rabbit.exe
cp AutoHotkey/GetCaretPosFromHook-${{ matrix.target }}.obj Lib/GetCaretPosEx/GetCaretPosFromHook.obj
cp Rime/${{ matrix.rime }} rime.dll
cp Icon/Rabbit.ico Rabbit.ico
cp CaretHook-${{ matrix.target }}/GetCaretPosFromHook-${{ matrix.target }}.obj Lib/GetCaretPosEx/GetCaretPosFromHook.obj
- name: Upload Rabbit ${{ matrix.target }}
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit ffa1410

Please sign in to comment.