|
38 | 38 | name: install
|
39 | 39 | path: _dest/
|
40 | 40 |
|
| 41 | + minimal-sdk-artifact: |
| 42 | + runs-on: windows-latest |
| 43 | + needs: [build] |
| 44 | + outputs: |
| 45 | + git-artifacts-extract-location: ${{ steps.git-artifacts-extract-location.outputs.result }} |
| 46 | + env: |
| 47 | + G4W_SDK_REPO: git-for-windows/git-sdk-64 |
| 48 | + steps: |
| 49 | + - name: get latest successful ci-artifacts run |
| 50 | + # Cannot just grab from https://github.com/git-for-windows/git-sdk-64/releases/tag/ci-artifacts |
| 51 | + # because we also need the git-artifacts |
| 52 | + id: ci-artifacts-run-id |
| 53 | + uses: actions/github-script@v7 |
| 54 | + with: |
| 55 | + script: | |
| 56 | + const [ owner, repo ] = process.env.G4W_SDK_REPO.split('/') |
| 57 | + const info = await github.rest.actions.listWorkflowRuns({ |
| 58 | + owner, |
| 59 | + repo, |
| 60 | + workflow_id: 938271, // ci-artifacts.yml |
| 61 | + status: 'success', |
| 62 | + per_page: 1 |
| 63 | + }) |
| 64 | + return info.data.workflow_runs[0].id |
| 65 | + - name: get the ci-artifacts build's artifacts |
| 66 | + shell: bash |
| 67 | + run: | |
| 68 | + run_id=${{ steps.ci-artifacts-run-id.outputs.result }} && |
| 69 | +
|
| 70 | + curl -H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \ |
| 71 | + -L https://api.github.com/repos/$G4W_SDK_REPO/actions/runs/$run_id/artifacts | |
| 72 | + jq -r '.artifacts[] | [.name, .archive_download_url] | @tsv' | |
| 73 | + tr -d '\r' | |
| 74 | + while read name url |
| 75 | + do |
| 76 | + echo "$name" |
| 77 | + curl -H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \ |
| 78 | + -#sLo /tmp/"$name".zip "$url" && |
| 79 | + unzip -qo /tmp/"$name".zip || |
| 80 | + exit $? |
| 81 | + done |
| 82 | + ls -la |
| 83 | + - uses: actions/download-artifact@v4 |
| 84 | + with: |
| 85 | + name: install |
| 86 | + path: install |
| 87 | + - name: overwrite MSYS2 runtime with the just-built msys2-runtime |
| 88 | + shell: bash |
| 89 | + run: | |
| 90 | + set -x && |
| 91 | + mkdir minimal-sdk && |
| 92 | + cd minimal-sdk && |
| 93 | + tar xzf ../git-sdk-x86_64-minimal.tar.gz && |
| 94 | + tar -C ../install -cf - . | tar xf - && |
| 95 | + tar cvf - * .[0-9A-Za-z]* | gzip -1 >../git-sdk-x86_64-minimal.tar.gz |
| 96 | + - name: upload minimal-sdk artifact |
| 97 | + uses: actions/upload-artifact@v4 |
| 98 | + with: |
| 99 | + name: minimal-sdk |
| 100 | + path: git-sdk-x86_64-minimal.tar.gz |
| 101 | + - name: run `uname` |
| 102 | + run: minimal-sdk\usr\bin\uname.exe -a |
| 103 | + - name: determine where `git-artifacts` want to be extracted |
| 104 | + id: git-artifacts-extract-location |
| 105 | + shell: bash |
| 106 | + run: | |
| 107 | + echo "result=$(tar Oxf git-artifacts.tar.gz git/bin-wrappers/git | |
| 108 | + sed -n 's|^GIT_EXEC_PATH='\''\(.*\)/git'\''$|\1|p')" >>$GITHUB_OUTPUT |
| 109 | + - name: upload git artifacts for testing |
| 110 | + uses: actions/upload-artifact@v4 |
| 111 | + with: |
| 112 | + name: git-artifacts |
| 113 | + path: git-artifacts.tar.gz |
| 114 | + |
| 115 | + test-minimal-sdk: |
| 116 | + needs: [minimal-sdk-artifact] |
| 117 | + uses: git-for-windows/git-sdk-64/.github/workflows/test-ci-artifacts.yml@main |
| 118 | + with: |
| 119 | + git-artifacts-extract-location: ${{ needs.minimal-sdk-artifact.outputs.git-artifacts-extract-location }} |
| 120 | + |
41 | 121 | generate-msys2-tests-matrix:
|
42 | 122 | runs-on: ubuntu-latest
|
43 | 123 | outputs:
|
|
0 commit comments