2525 value : ${{ jobs.build.outputs.unsigned-artifact-id }}
2626
2727jobs :
28- build :
29- runs-on : windows-latest
30- name : Build
31- outputs :
32- unsigned-artifact-id : ${{ steps.upload-unsigned.outputs.artifact-id }}
33-
28+ cross-build :
29+ runs-on : ubuntu-latest
30+ container : quay.io/fedora/fedora:42
31+ name : Cross Build
3432 steps :
33+ - name : Install build dependencies
34+ run : |
35+ sudo dnf -y install clang sqlite-devel rustup git
36+ sudo dnf -y install mingw32-binutils mingw32-gcc mingw32-sqlite-static mingw32-zlib-static
37+ sudo dnf -y install mingw64-binutils mingw64-gcc mingw64-sqlite-static mingw64-zlib-static
38+ rustup-init -y
39+ source "$HOME/.cargo/env"
40+ rustup set auto-self-update disable
41+ rustup target add i686-pc-windows-gnu
42+ rustup target add x86_64-pc-windows-gnu
43+
3544 - uses : actions/checkout@v4
3645 with :
3746 submodules : true
@@ -40,10 +49,43 @@ jobs:
4049 if : ${{ inputs.nightly }}
4150 run : git submodule update --remote
4251
43- - name : Setup rustup
52+ - name : Generate nightly version info
53+ if : ${{ inputs.nightly }}
4454 run : |
45- rustup install stable
46- rustup target add i686-pc-windows-msvc
55+ source "$HOME/.cargo/env"
56+ cargo xtask update-version --major $VER_MAJOR --minor $VER_MINOR --patch $VER_PATCH -b $GITHUB_RUN_NUMBER
57+ cat version.rc
58+ cat installer/version.wxi
59+
60+ - name : Generate pull_request version info
61+ if : github.event_name == 'pull_request'
62+ env :
63+ PR_NUMBER : ${{ github.event.number }}
64+ run : |
65+ source "$HOME/.cargo/env"
66+ cargo xtask update-version --major 0 --minor 0 --patch $PR_NUMBER -b $GITHUB_RUN_NUMBER
67+ cat version.rc
68+ cat installer/version.wxi
69+
70+ - name : Build
71+ run : |
72+ source "$HOME/.cargo/env"
73+ sh scripts/cross_build.sh
74+
75+ - uses : actions/upload-artifact@v4
76+ with :
77+ name : Installer Artifact
78+ path : build/installer
79+
80+ build :
81+ runs-on : windows-latest
82+ name : Package
83+ outputs :
84+ unsigned-artifact-id : ${{ steps.upload-unsigned.outputs.artifact-id }}
85+ needs : [cross-build]
86+
87+ steps :
88+ - uses : actions/checkout@v4
4789
4890 - name : Add msbuild to PATH
4991 uses : microsoft/setup-msbuild@v2
@@ -55,36 +97,16 @@ jobs:
5597 # SSH_PASS: ${{ secrets.SSH_PASS }}
5698 # NGROK_REGION: jp
5799
58- - name : Setup vcpkg
59- shell : cmd
60- run : |
61- set VCPKG_ROOT=%VCPKG_INSTALLATION_ROOT%
62- vcpkg install --triplet x86-windows-static sqlite3
63- vcpkg install --triplet x64-windows-static sqlite3
64-
65- - name : Generate nightly version info
66- if : ${{ inputs.nightly }}
67- run : |
68- cargo xtask update-version --major $env:VER_MAJOR --minor $env:VER_MINOR --patch $env:VER_PATCH -b $env:GITHUB_RUN_NUMBER
69- type version.rc
70- type installer/version.wxi
71-
72- - name : Generate pull_request version info
73- if : github.event_name == 'pull_request'
74- env :
75- PR_NUMBER : ${{ github.event.number }}
76- run : |
77- cargo xtask update-version --major 0 --minor 0 --patch $env:PR_NUMBER -b $env:GITHUB_RUN_NUMBER
78- type version.rc
79- type installer/version.wxi
100+ - name : Download Installer Artifact
101+ uses : actions/download-artifact@v4
102+ with :
103+ name : Installer Artifact
104+ path : build/installer
80105
81- - name : Build
106+ - name : Build Package
82107 shell : cmd
83108 run : |
84- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\vsdevcmd.bat"
85- set VCPKG_ROOT=%VCPKG_INSTALLATION_ROOT%
86- set CMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake
87- scripts/build_installer.bat
109+ scripts/package_installer.bat
88110
89111 - id : upload-unsigned
90112 uses : actions/upload-artifact@v4
0 commit comments