66 package_name :
77 description : " Package name to build"
88 type : string
9- needs :
10- description : " Parent workflow job dependencies"
11- type : string
12- dependencies :
13- description : " Install additional dependencies"
14- type : string
15- default : " "
169 packages_repository :
1710 description : " MSYS2 packages repository to build from"
1811 type : string
2114 description : " MSYS2 packages branch to build from"
2215 type : string
2316 default : " woarm64"
17+ runner_arch :
18+ description : " Architecture to build on"
19+ type : string
20+ default : " x86_64"
21+ needs :
22+ description : " Parent workflow job dependencies"
23+ type : string
24+ dependencies :
25+ description : " Install additional dependencies"
26+ type : string
27+ default : " "
2428
2529defaults :
2630 run :
2731 shell : msys2 {0}
2832
2933env :
3034 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
35+ CLEAN_BUILD : 1
3136
3237jobs :
3338 build :
3439 name : Build ${{ inputs.package_name }}
35- runs-on : windows-latest
40+ runs-on : >-
41+ ${{ fromJson(inputs.runner_arch == 'aarch64'
42+ && '["Windows", "ARM64", "Blackhex"]'
43+ || '["windows-latest"]') }}
3644
3745 steps :
38- - uses : msys2/setup-msys2@v2
46+ - name : Kill hanging processes
47+ if : ${{ inputs.runner_arch == 'aarch64' }}
48+ shell : powershell
49+ run : |
50+ tasklist
51+ taskkill /F /FI 'MODULES eq msys-2.0.dll'
52+ tasklist
53+ Set-Location "${{ github.workspace }}"
54+ Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path packages
55+ exit 0
56+
57+ - name : Fix Git long paths
58+ if : ${{ inputs.runner_arch == 'aarch64' }}
59+ shell : powershell
60+ run : |
61+ git config --global core.longpaths true
62+
63+ - name : Fix $PATH
64+ if : ${{ inputs.runner_arch == 'aarch64' }}
65+ shell : powershell
66+ run : |
67+ Write-Output "GITHUB_PATH: $env:GITHUB_PATH"
68+ Write-Output "C:\Program Files\Git\usr\bin\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
69+
70+ - uses : Windows-on-ARM-Experiments/setup-msys2@main
71+ timeout-minutes : 10
3972 with :
40- msystem : ${{ contains(inputs.packages_repository, 'MINGW') && 'MINGW64' || 'MSYS' }}
41- update : true
42- cache : true
73+ msystem : >-
74+ ${{ contains(inputs.packages_repository, 'MINGW')
75+ && ((inputs.runner_arch == 'aarch64') && 'MINGWARM64' || 'MINGW64')
76+ || 'MSYS' }}
77+ update : ${{ inputs.runner_arch == 'x86_64' }}
78+ cache : ${{ inputs.runner_arch == 'x86_64' }}
4379
4480 - name : Checkout repository
4581 uses : actions/checkout@v4
4682
83+ - name : Checkout ${{ inputs.packages_repository }} repository
84+ uses : actions/checkout@v4
85+ with :
86+ repository : ${{ inputs.packages_repository }}
87+ ref : ${{ inputs.packages_branch }}
88+ sparse-checkout : ${{ inputs.package_name }}
89+ path : ${{ github.workspace }}/packages
90+
91+ - name : Pacman hang workaround
92+ if : ${{ inputs.runner_arch == 'aarch64' }}
93+ run : |
94+ `cygpath "${{ github.workspace }}"`/.github/scripts/pacman-workaround.sh
95+
96+ - name : First MSYS2 update
97+ if : ${{ inputs.runner_arch == 'aarch64' }}
98+ shell : powershell
99+ run : |
100+ msys2 -c 'pacman -Syuu --noconfirm'
101+ exit 0
102+
103+ - name : Second MSYS2 update
104+ if : ${{ inputs.runner_arch == 'aarch64' }}
105+ shell : powershell
106+ run : |
107+ msys2 -c 'pacman -Syuu --noconfirm'
108+
109+ - name : Setup packages repository
110+ if : ${{ inputs.runner_arch == 'aarch64' }}
111+ run : |
112+ `cygpath "${{ github.workspace }}"`/.github/scripts/setup-repository.sh
113+
47114 - name : Install dependencies
48115 run : |
49116 pacman -S --noconfirm \
50117 git \
51118 mingw-w64-x86_64-github-cli \
52119 mingw-w64-x86_64-jq \
53120 base-devel \
54- ${{ contains(inputs.packages_repository, 'MINGW') && 'mingw-w64-cross-gcc mingw-w64-x86_64-ccache ' || ' ccache ' }} \
121+ ${{ contains(inputs.packages_repository, 'MINGW') && 'mingw-w64-cross-mingwarm64- gcc mingw-w64-cross-mingwarm64-windows-default-manifest mingw-w64- x86_64-gcc-libs ' || '' }} \
55122 ${{ inputs.dependencies }}
56123
57124 - name : Download artifacts
@@ -69,21 +136,18 @@ jobs:
69136 run : |
70137 `cygpath "${{ github.workspace }}"`/.github/scripts/pthread-headers-hack-before.sh
71138
72- - name : Checkout ${{ inputs.packages_repository }} repository
73- uses : actions/checkout@v4
74- with :
75- repository : ${{ inputs.packages_repository }}
76- ref : ${{ inputs.packages_branch }}
77- sparse-checkout : ${{ inputs.package_name }}
78- path : ${{ github.workspace }}/packages
139+ - name : Setup MINGWARM64 environment
140+ if : ${{ inputs.runner_arch == 'aarch64' }}
141+ run : |
142+ `cygpath "${{ github.workspace }}"`/.github/scripts/setup-mingwarm64.sh
79143
80144 - name : Enable Ccache
81145 id : enable-ccache
82146 run : |
83147 `cygpath "${{ github.workspace }}"`/.github/scripts/enable-ccache.sh
84148
85149 - name : Restore Ccache
86- uses : actions/cache/restore@v4
150+ uses : actions/cache/restore@v4
87151 with :
88152 path : ${{ github.workspace }}/ccache
89153 key : main-ccache-${{ steps.enable-ccache.outputs.timestamp }}
@@ -92,13 +156,11 @@ jobs:
92156 - name : Build ${{ inputs.package_name }}
93157 working-directory : ${{ github.workspace }}/packages/${{ inputs.package_name }}
94158 run : |
95- ccache -svv || true
96159 `cygpath "${{ github.workspace }}"`/.github/scripts/build-package.sh ${{ inputs.packages_repository }}
97- ccache -svv || true
98160
99161 - name : Save Ccache
100162 if : always()
101- uses : actions/cache/save@v4
163+ uses : actions/cache/save@v4
102164 with :
103165 path : ${{ github.workspace }}/ccache
104166 key : main-ccache-${{ steps.enable-ccache.outputs.timestamp }}
0 commit comments