|
4 | 4 | workflow_dispatch:
|
5 | 5 | inputs:
|
6 | 6 | build_only:
|
7 |
| - description: 'Optionally restrict what artifacts to build. Separate artifacts with spaces' |
| 7 | + description: 'Optionally restrict what artifacts to build (portable, installer, etc.). Separate artifacts with spaces' |
8 | 8 | required: false
|
9 | 9 | ref:
|
10 | 10 | description: 'Optionally override which branch to build'
|
@@ -128,6 +128,8 @@ jobs:
|
128 | 128 | pkg:
|
129 | 129 | runs-on: windows-latest
|
130 | 130 | needs: bundle-artifacts
|
| 131 | + outputs: |
| 132 | + artifact_matrix: ${{steps.artifact-build-matrix.outputs.matrix}} |
131 | 133 | env:
|
132 | 134 | MSYSTEM: ${{ needs.bundle-artifacts.outputs.msystem }}
|
133 | 135 | MINGW_PREFIX: ${{ needs.bundle-artifacts.outputs.mingw_prefix }}
|
@@ -227,3 +229,81 @@ jobs:
|
227 | 229 | with:
|
228 | 230 | name: pkg-${{env.ARCHITECTURE}}
|
229 | 231 | path: artifacts
|
| 232 | + - uses: actions/setup-node@v3 |
| 233 | + with: |
| 234 | + node-version: 16 |
| 235 | + - name: Prepare artifact build matrix |
| 236 | + id: artifact-build-matrix |
| 237 | + run: | |
| 238 | + ARTIFACTS=$(test -n "$BUILD_ONLY" && echo $BUILD_ONLY || echo "installer portable archive mingit mingit-busybox") |
| 239 | + MATRIX=$(node ./create-artifacts-matrix.js $ARTIFACTS) |
| 240 | + echo "matrix=$MATRIX" >> $GITHUB_OUTPUT |
| 241 | + artifacts: |
| 242 | + runs-on: windows-latest |
| 243 | + needs: [bundle-artifacts, pkg] |
| 244 | + env: |
| 245 | + MSYSTEM: ${{ needs.bundle-artifacts.outputs.msystem }} |
| 246 | + BITNESS: ${{ needs.bundle-artifacts.outputs.bitness }} |
| 247 | + strategy: |
| 248 | + fail-fast: false |
| 249 | + matrix: ${{ fromJSON(needs.pkg.outputs.artifact_matrix) }} |
| 250 | + steps: |
| 251 | + - name: Download pkg-${{env.ARCHITECTURE}} |
| 252 | + uses: actions/download-artifact@v3 |
| 253 | + with: |
| 254 | + name: pkg-${{env.ARCHITECTURE}} |
| 255 | + path: pkg-${{env.ARCHITECTURE}} |
| 256 | + - name: Download bundle-artifacts |
| 257 | + uses: actions/download-artifact@v3 |
| 258 | + with: |
| 259 | + name: bundle-artifacts |
| 260 | + path: bundle-artifacts |
| 261 | + - uses: git-for-windows/setup-git-for-windows-sdk@v1 |
| 262 | + with: |
| 263 | + flavor: build-installers |
| 264 | + architecture: ${{env.ARCHITECTURE}} |
| 265 | + - name: Clone and update build-extra |
| 266 | + run: | |
| 267 | + d=/usr/src/build-extra && |
| 268 | + if test ! -d $d/.git |
| 269 | + then |
| 270 | + git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d |
| 271 | + else |
| 272 | + git -C $d fetch https://github.com/git-for-windows/build-extra main && |
| 273 | + git -C $d switch -C main FETCH_HEAD |
| 274 | + fi && |
| 275 | + git -C $d pull "$PWD"/bundle-artifacts/build-extra.bundle main |
| 276 | + - name: Prepare home directory for code-signing |
| 277 | + env: |
| 278 | + CODESIGN_P12: ${{secrets.CODESIGN_P12}} |
| 279 | + CODESIGN_PASS: ${{secrets.CODESIGN_PASS}} |
| 280 | + if: (matrix.artifact.name == 'installer' || matrix.artifact.name == 'portable') && env.CODESIGN_P12 != '' && env.CODESIGN_PASS != '' |
| 281 | + run: | |
| 282 | + mkdir -p home/.sig && |
| 283 | + echo -n "$CODESIGN_P12" | tr % '\n' | base64 -d >home/.sig/codesign.p12 && |
| 284 | + echo -n "$CODESIGN_PASS" >home/.sig/codesign.pass && |
| 285 | + git config --global alias.signtool '!sh "/usr/src/build-extra/signtool.sh"' |
| 286 | + - name: Build ${{env.ARCHITECTURE}} ${{matrix.artifact.name}} |
| 287 | + run: | |
| 288 | + set -x |
| 289 | + eval /usr/src/build-extra/please.sh make_installers_from_mingw_w64_git --version=$(cat pkg-${{env.ARCHITECTURE}}/ver) -o artifacts --${{matrix.artifact.name}} --pkg=pkg-${{env.ARCHITECTURE}}/mingw-w64-${{env.ARCHITECTURE}}-git-[0-9]*.tar.xz --pkg=pkg-${{env.ARCHITECTURE}}/mingw-w64-${{env.ARCHITECTURE}}-git-doc-html-[0-9]*.tar.xz && |
| 290 | + if test portable = '${{matrix.artifact.name}}' && test -n "$(git config alias.signtool)" |
| 291 | + then |
| 292 | + git signtool artifacts/PortableGit-*.exe |
| 293 | + fi && |
| 294 | + openssl dgst -sha256 artifacts/${{matrix.artifact.fileprefix}}-*.${{matrix.artifact.fileextension}} | sed "s/.* //" >artifacts/sha-256.txt |
| 295 | + - name: Copy package-versions and pdbs |
| 296 | + if: matrix.artifact.name == 'installer' |
| 297 | + run: | |
| 298 | + cp /usr/src/build-extra/installer/package-versions.txt artifacts/ && |
| 299 | + a=$PWD/artifacts && |
| 300 | + p=$PWD/pkg-${{env.ARCHITECTURE}} && |
| 301 | + (cd /usr/src/build-extra && |
| 302 | + mkdir -p cached-source-packages && |
| 303 | + cp "$p"/*-pdb* cached-source-packages/ && |
| 304 | + GIT_CONFIG_PARAMETERS="'windows.sdk${{env.BITNESS}}.path='" ./please.sh bundle_pdbs --arch=${{env.ARCHITECTURE}} --directory="$a" installer/package-versions.txt) |
| 305 | + - name: Publish ${{matrix.artifact.name}}-${{env.ARCHITECTURE}} |
| 306 | + uses: actions/upload-artifact@v3 |
| 307 | + with: |
| 308 | + name: ${{matrix.artifact.name}}-${{env.ARCHITECTURE}} |
| 309 | + path: artifacts |
0 commit comments