!1249 [201_38] 通过插入图片选项插入的图片默认居中 #166
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CD for Mogan STEM on Windows | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - '*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| windowsbuild: | |
| runs-on: windows-2025 | |
| timeout-minutes: 45 | |
| steps: | |
| - uses: xmake-io/github-action-setup-xmake@v1 | |
| with: | |
| xmake-version: v3.0.4 | |
| - name: update repo | |
| run: | | |
| xrepo update-repo | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 1 | |
| - uses: MinoruSekine/setup-scoop@v4.0.1 | |
| with: | |
| install_scoop: 'true' | |
| buckets: main | |
| apps: wget pandoc ghostscript | |
| update_path: 'true' | |
| - name: Noto fonts | |
| shell: pwsh | |
| run: | | |
| mkdir D:\a\mogan\mogan\TeXmacs\fonts\opentype\noto | |
| cd D:\a\mogan\mogan\TeXmacs\fonts\opentype\noto | |
| wget https://github.com/XmacsLabs/mogan/releases/download/v1.2.9.7/NotoSansCJK-Bold.ttc | |
| wget https://github.com/XmacsLabs/mogan/releases/download/v1.2.9.7/NotoSansCJK-Regular.ttc | |
| wget https://github.com/XmacsLabs/mogan/releases/download/v1.2.9.7/NotoSerifCJK-Bold.ttc | |
| wget https://github.com/XmacsLabs/mogan/releases/download/v1.2.9.7/NotoSerifCJK-Regular.ttc | |
| - name: config | |
| run: xmake config --yes -vD -m release | |
| - name: build | |
| run: xmake build -vD stem | |
| - name: install | |
| run: xmake install -vD stem | |
| - name: gs and pandoc | |
| run: | | |
| cp ~\scoop\apps\pandoc\current\pandoc.exe D:\a\mogan\mogan\build\packages\stem\data\bin | |
| wget https://github.com/XmacsLabs/mogan/releases/download/v1.2.9.7/gs.exe | |
| - name: Generate Installer | |
| run: xmake pack --yes -vD stem | |
| - name: Rename installer using XMACS_VERSION | |
| shell: pwsh | |
| run: | | |
| $content = Get-Content "xmake/vars.lua" -Raw -ErrorAction SilentlyContinue | |
| if ($content -match 'XMACS_VERSION.*"(.*)"') { | |
| $ver = $Matches[1] | |
| Write-Host "Found version: $ver" | |
| $packDir = Join-Path -Path "build" -ChildPath "xpack/stem" | |
| if (Test-Path $packDir) { | |
| $exe = Get-ChildItem -Path $packDir -Filter "*.exe" | Sort-Object LastWriteTime -Descending | Select-Object -First 1 | |
| if ($exe) { | |
| $newName = "MoganSTEM-v${ver}-64bit-installer.exe" | |
| Write-Host "Renaming $($exe.Name) -> $newName" | |
| Rename-Item -Path $exe.FullName -NewName $newName -Force | |
| Write-Host "Rename complete" | |
| } else { | |
| Write-Warning "No .exe installer found in $packDir" | |
| } | |
| } else { | |
| Write-Warning "Package directory '$packDir' not found" | |
| } | |
| } | |
| - name: Upload | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
| with: | |
| path: | | |
| build/xpack/stem/*.exe | |
| - name: Release | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| prerelease: true | |
| files: | | |
| build/xpack/stem/*.exe |