1717 minimal-sdk-artifact :
1818 if : github.repository_owner == 'git-for-windows'
1919 runs-on : windows-11-arm
20+ outputs :
21+ git-artifacts-extract-location : ${{ steps.git-artifacts-extract-location.outputs.result }}
2022 steps :
2123 - name : clone git-sdk-arm64
2224 run : |
3638 - name : compress artifact
3739 shell : bash
3840 run : mkdir artifacts && (cd minimal-sdk && tar cvf - * .[0-9A-Za-z]*) | gzip -1 >artifacts/git-sdk-aarch64-minimal.tar.gz
41+ - name : upload minimal-sdk artifact
42+ uses : actions/upload-artifact@v4
43+ with :
44+ name : minimal-sdk
45+ path : artifacts/git-sdk-aarch64-minimal.tar.gz
46+ - name : clone git.git's `master`
47+ run : git clone --depth=1 --branch master https://github.com/git/git ..\git
48+ - name : build current `master` of git.git
49+ shell : bash
50+ run : |
51+ set -x
52+ . /etc/profile
53+ test "$(cygpath -aw /)" = "${{github.workspace}}\minimal-sdk" || exit 1
54+ test "$(type -p gcc)" = "/clangarm64/bin/gcc" || exit 1
55+ make -C ../git DEVELOPER=1 NO_PERL=1 SKIP_DASHED_BUILT_INS=YesPlease -j8 all strip
56+ - name : compress git artifacts
57+ shell : bash
58+ run : tar -C .. -czf git-artifacts.tar.gz --exclude '*.a' --exclude '*.o' --exclude .git --exclude .depend git
59+ - name : upload git artifacts for testing
60+ uses : actions/upload-artifact@v4
61+ with :
62+ name : git-artifacts
63+ path : git-artifacts.tar.gz
64+ - name : determine where `git-artifacts` want to be extracted
65+ id : git-artifacts-extract-location
66+ shell : bash
67+ run : |
68+ cd .. &&
69+ echo "result=$(pwd)" >>$GITHUB_OUTPUT
3970 - name : create zip and 7z SFX variants of the minimal SDK
4071 if : github.event_name == 'push' && github.ref == 'refs/heads/main'
4172 shell : bash
@@ -44,51 +75,44 @@ jobs:
4475 do
4576 git --git-dir=git-sdk-arm64.git show HEAD:$path >${path##*/}
4677 done &&
47- (cd minimal-sdk && ../7z.exe a -mmt=on -mx9 ../artifacts/git-sdk-aarch64-minimal.zip * .?*) &&
78+ mkdir minimal-sdk-extra &&
79+ (cd minimal-sdk && ../7z.exe a -mmt=on -mx9 ../minimal-sdk-extra/git-sdk-aarch64-minimal.zip * .?*) &&
4880 (cd minimal-sdk && ../7z.exe a -t7z -mmt=on -m0=lzma -mqs -mlc=8 -mx=9 -md=256M -mfb=273 -ms=256M -sfx../7zCon.sfx \
49- ../artifacts/git-sdk-aarch64-minimal.7z.exe * .?*)
50- - name : run some tests
51- shell : bash
52- run : |
53- set -x
54- . /etc/profile
55-
56- # cygpath works
57- test "$(cygpath -aw /)" = "${{github.workspace}}\minimal-sdk" || exit 1
58-
59- # comes with Clang and can compile a DLL
60- test "$(type -p clang)" = "/clangarm64/bin/clang" || exit 1
61- cat >dll.c <<-\EOF &&
62- __attribute__((dllexport)) int increment(int i)
63- {
64- return i + 1;
65- }
66- EOF
67-
68- clang -Wall -g -O2 -shared -o sample.dll dll.c || exit 1
69- ls -la
81+ ../minimal-sdk-extra/git-sdk-aarch64-minimal.7z.exe * .?*)
82+ - name : upload minimal-sdk-extra artifacts
83+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
84+ uses : actions/upload-artifact@v4
85+ with :
86+ name : minimal-sdk-extra
87+ path : minimal-sdk-extra
7088
71- # stat works
72- test "stat is /usr/bin/stat" = "$(type stat)" || exit 1
73- stat /usr/bin/stat.exe || exit 1
89+ test-minimal-sdk :
90+ needs : minimal-sdk-artifact
91+ uses : ./.github/workflows/test-ci-artifacts.yml
92+ with :
93+ git-artifacts-extract-location : ${{ needs.minimal-sdk-artifact.outputs.git-artifacts-extract-location }}
94+ permissions :
95+ contents : read
7496
75- # unzip works
76- test "unzip is /usr/bin/unzip" = "$(type unzip)" || exit 1
77- git init unzip-test &&
78- echo TEST >unzip-test/README &&
79- git -C unzip-test add -A &&
80- git -C unzip-test -c user.name=A -c [email protected] commit -m 'Testing, testing...' && 81- git --git-dir=unzip-test/.git archive -o test.zip HEAD &&
82- unzip -v test.zip >unzip-test.out &&
83- cat unzip-test.out &&
84- test "grep is /usr/bin/grep" = "$(type grep)" || exit 1
85- grep README unzip-test.out
97+ publish-release-assets :
98+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
99+ runs-on : ubuntu-latest
100+ needs : test-minimal-sdk
101+ steps :
102+ - name : download minimal-sdk artifact
103+ uses : actions/download-artifact@v4
104+ with :
105+ name : minimal-sdk
106+ path : ${{github.workspace}}
107+ - name : download minimal-sdk artifact
108+ uses : actions/download-artifact@v4
109+ with :
110+ name : minimal-sdk-extra
111+ path : ${{github.workspace}}
86112 - name : publish release assets
87- if : github.event_name == 'push' && github.ref == 'refs/heads/main'
88113 uses : actions/github-script@v7
89114 with :
90115 script : |
91- process.chdir('artifacts')
92116 const req = { owner: context.repo.owner, repo: context.repo.repo }
93117 // find or create the GitHub release named `ci-artifacts`
94118 const release = await (async () => {
@@ -157,4 +181,4 @@ jobs:
157181 ...req,
158182 ref: 'tags/ci-artifacts',
159183 sha: process.env.GITHUB_SHA,
160- })
184+ })
0 commit comments