1212 default : ' rc'
1313 required : true
1414
15-
1615permissions :
1716 contents : write # needed to write releases
1817 id-token : write # needed for keyless signing
1918
2019jobs :
21-
2220 linux-x86_64-all-libs :
2321 runs-on : ubuntu-latest
2422 steps :
2927 TARGET_DIR=${GITHUB_WORKSPACE}/build/libgit2-linux-all-libs \
3028 BUILD_ROOT_DIR=${GITHUB_WORKSPACE}/libgit2/build/amd \
3129 ./hack/static.sh all
32-
30+
3331 mkdir -p ./libgit2-linux-all-libs/
3432 mv ${GITHUB_WORKSPACE}/build/libgit2-linux-all-libs/include ./libgit2-linux-all-libs/
3533 mv ${GITHUB_WORKSPACE}/build/libgit2-linux-all-libs/share ./libgit2-linux-all-libs/
4139 - uses : actions/upload-artifact@v3
4240 with :
4341 name : release-artifact
44- path : ' *.tar.gz'
42+ path : " *.tar.gz"
4543 if-no-files-found : error
4644
4745 linux-x86_64-libgit2-only :
6462 - uses : actions/upload-artifact@v3
6563 with :
6664 name : release-artifact
67- path : ' *.tar.gz'
65+ path : " *.tar.gz"
6866 if-no-files-found : error
6967
7068 darwin-all-libs :
7573 # both outcomes onto a single binary for each static library.
7674 #
7775 # `macos-11` has been picked as support for arm64 was only added on Xcode 12.
78- # Although some minor versions of Catalina 10.15 can support it, at the time
79- # of testing, GitHub's macos-10.15 did not seem to.
76+ # Although some minor versions of Catalina 10.15 can support it, at the time
77+ # of testing, GitHub's macos-10.15 did not seem to.
8078 # Cross-compiling to arm64 on that runner consistently failed.
8179 runs-on : macos-11
8280 steps :
@@ -90,22 +88,21 @@ jobs:
9088 TARGET_DIR=${GITHUB_WORKSPACE}/build/darwin-all-libs \
9189 BUILD_ROOT_DIR=${GITHUB_WORKSPACE}/libgit2/build/amd \
9290 ./hack/static.sh all
93-
91+
9492 TARGET_DIR=${GITHUB_WORKSPACE}/build/libgit2-darwin-arm64 \
9593 BUILD_ROOT_DIR=${GITHUB_WORKSPACE}/libgit2/build/arm \
9694 TARGET_ARCH=arm64 \
9795 CMAKE_APPLE_SILICON_PROCESSOR=arm64 \
9896 ./hack/static.sh all
9997
10098
101- LIBGIT2_SED="s;-L/Applications/Xcode_ .* ;;g"
99+ LIBGIT2_SED="s;-L/Applications/Xcode .* ;;g"
102100 LIBGIT2PC="${GITHUB_WORKSPACE}/build/darwin-all-libs/lib/pkgconfig/libgit2.pc"
103101
104- # pkgconfig files may contain absolute paths to its dependencies that is specific
105- # to the runner - machine used to compile the library.
106- # We need to remove the absolute path of iconv, so when the library is consumed
107- # pkgconfig will automatically try to find it through the default search paths
108- # on the target machine.
102+ # pkgconfig includes absolute paths that are specific to the runner machine.
103+ # We need to remove the absolute path for iconv, so when the libgit2 library
104+ # is consumed pkgconfig will automatically try to find it through the default
105+ # search paths on the target machine.
109106 if command -v gsed &> /dev/null; then
110107 gsed -i "${LIBGIT2_SED}" "${LIBGIT2PC}"
111108 else
@@ -147,7 +144,7 @@ jobs:
147144 - uses : actions/upload-artifact@v3
148145 with :
149146 name : release-artifact
150- path : ' *.tar.gz'
147+ path : " *.tar.gz"
151148 if-no-files-found : error
152149
153150 # similar to darwin-all-libs, but only compiles libgit2.
@@ -168,6 +165,19 @@ jobs:
168165 CMAKE_APPLE_SILICON_PROCESSOR=arm64 \
169166 ./hack/static.sh build_libgit2_only
170167
168+ LIBGIT2_SED="s;-L/Applications/Xcode.* ;;g"
169+ LIBGIT2PC="${GITHUB_WORKSPACE}/build/libgit2-darwin-amd64/lib/pkgconfig/libgit2.pc"
170+
171+ # pkgconfig includes absolute paths that are specific to the runner machine.
172+ # We need to remove the absolute path for iconv, so when the libgit2 library
173+ # is consumed pkgconfig will automatically try to find it through the default
174+ # search paths on the target machine.
175+ if command -v gsed &> /dev/null; then
176+ gsed -i "${LIBGIT2_SED}" "${LIBGIT2PC}"
177+ else
178+ sed -i "" "${LIBGIT2_SED}" "${LIBGIT2PC}"
179+ fi
180+
171181 mkdir -p ./darwin-libgit2-only/lib
172182 mv ${GITHUB_WORKSPACE}/build/libgit2-darwin-amd64/include ./darwin-libgit2-only/
173183
@@ -182,13 +192,19 @@ jobs:
182192 - uses : actions/upload-artifact@v3
183193 with :
184194 name : release-artifact
185- path : ' *.tar.gz'
195+ path : " *.tar.gz"
186196 if-no-files-found : error
187197
188198 goreleaser :
189199 runs-on : ubuntu-latest
190- needs : [linux-x86_64-all-libs, linux-x86_64-libgit2-only, darwin-all-libs, darwin-libgit2-only]
191- if : ${{ always() && contains(join(needs.*.result, ','), 'success') }}
200+ needs :
201+ [
202+ linux-x86_64-all-libs,
203+ linux-x86_64-libgit2-only,
204+ darwin-all-libs,
205+ darwin-libgit2-only,
206+ ]
207+ if : ${{ always() && contains(join(needs.*.result, ','), 'success') }}
192208 steps :
193209 - uses : actions/checkout@v3
194210 with :
0 commit comments