12
12
default : ' rc'
13
13
required : true
14
14
15
-
16
15
permissions :
17
16
contents : write # needed to write releases
18
17
id-token : write # needed for keyless signing
19
18
20
19
jobs :
21
-
22
20
linux-x86_64-all-libs :
23
21
runs-on : ubuntu-latest
24
22
steps :
29
27
TARGET_DIR=${GITHUB_WORKSPACE}/build/libgit2-linux-all-libs \
30
28
BUILD_ROOT_DIR=${GITHUB_WORKSPACE}/libgit2/build/amd \
31
29
./hack/static.sh all
32
-
30
+
33
31
mkdir -p ./libgit2-linux-all-libs/
34
32
mv ${GITHUB_WORKSPACE}/build/libgit2-linux-all-libs/include ./libgit2-linux-all-libs/
35
33
mv ${GITHUB_WORKSPACE}/build/libgit2-linux-all-libs/share ./libgit2-linux-all-libs/
41
39
- uses : actions/upload-artifact@v3
42
40
with :
43
41
name : release-artifact
44
- path : ' *.tar.gz'
42
+ path : " *.tar.gz"
45
43
if-no-files-found : error
46
44
47
45
linux-x86_64-libgit2-only :
64
62
- uses : actions/upload-artifact@v3
65
63
with :
66
64
name : release-artifact
67
- path : ' *.tar.gz'
65
+ path : " *.tar.gz"
68
66
if-no-files-found : error
69
67
70
68
darwin-all-libs :
75
73
# both outcomes onto a single binary for each static library.
76
74
#
77
75
# `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.
80
78
# Cross-compiling to arm64 on that runner consistently failed.
81
79
runs-on : macos-11
82
80
steps :
@@ -90,22 +88,21 @@ jobs:
90
88
TARGET_DIR=${GITHUB_WORKSPACE}/build/darwin-all-libs \
91
89
BUILD_ROOT_DIR=${GITHUB_WORKSPACE}/libgit2/build/amd \
92
90
./hack/static.sh all
93
-
91
+
94
92
TARGET_DIR=${GITHUB_WORKSPACE}/build/libgit2-darwin-arm64 \
95
93
BUILD_ROOT_DIR=${GITHUB_WORKSPACE}/libgit2/build/arm \
96
94
TARGET_ARCH=arm64 \
97
95
CMAKE_APPLE_SILICON_PROCESSOR=arm64 \
98
96
./hack/static.sh all
99
97
100
98
101
- LIBGIT2_SED="s;-L/Applications/Xcode_ .* ;;g"
99
+ LIBGIT2_SED="s;-L/Applications/Xcode .* ;;g"
102
100
LIBGIT2PC="${GITHUB_WORKSPACE}/build/darwin-all-libs/lib/pkgconfig/libgit2.pc"
103
101
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.
109
106
if command -v gsed &> /dev/null; then
110
107
gsed -i "${LIBGIT2_SED}" "${LIBGIT2PC}"
111
108
else
@@ -147,7 +144,7 @@ jobs:
147
144
- uses : actions/upload-artifact@v3
148
145
with :
149
146
name : release-artifact
150
- path : ' *.tar.gz'
147
+ path : " *.tar.gz"
151
148
if-no-files-found : error
152
149
153
150
# similar to darwin-all-libs, but only compiles libgit2.
@@ -168,6 +165,19 @@ jobs:
168
165
CMAKE_APPLE_SILICON_PROCESSOR=arm64 \
169
166
./hack/static.sh build_libgit2_only
170
167
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
+
171
181
mkdir -p ./darwin-libgit2-only/lib
172
182
mv ${GITHUB_WORKSPACE}/build/libgit2-darwin-amd64/include ./darwin-libgit2-only/
173
183
@@ -182,13 +192,19 @@ jobs:
182
192
- uses : actions/upload-artifact@v3
183
193
with :
184
194
name : release-artifact
185
- path : ' *.tar.gz'
195
+ path : " *.tar.gz"
186
196
if-no-files-found : error
187
197
188
198
goreleaser :
189
199
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') }}
192
208
steps :
193
209
- uses : actions/checkout@v3
194
210
with :
0 commit comments