Skip to content

Commit e2ed0a0

Browse files
committed
chore: fix the release config for static build
Signed-off-by: chlins <[email protected]>
1 parent ce0219d commit e2ed0a0

File tree

4 files changed

+25
-21
lines changed

4 files changed

+25
-21
lines changed

.github/workflows/lint.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,6 @@ jobs:
2020
with:
2121
fetch-depth: '0'
2222

23-
- name: Install dependencies
24-
run: |
25-
sudo apt-get update
26-
sudo apt-get install -y pkg-config
27-
sudo apt update && \
28-
sudo DEBIAN_FRONTEND=noninteractive apt install -y build-essential cmake pkg-config libssl-dev libssh2-1-dev zlib1g-dev libhttp-parser-dev python3 wget tar git && \
29-
wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.5.1.tar.gz -O libgit2-v1.5.1.tar.gz && \
30-
tar -xzf libgit2-v1.5.1.tar.gz && \
31-
cd libgit2-1.5.1 && \
32-
mkdir build && \
33-
cd build && \
34-
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF && \
35-
make -j$(nproc) && \
36-
sudo make install && \
37-
sudo ldconfig
38-
env:
39-
LIBGIT2_SYS_USE_PKG_CONFIG: "1"
40-
4123
- name: Golangci lint
4224
uses: golangci/[email protected]
4325
with:

.github/workflows/release.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ jobs:
3333
sudo apt-get update
3434
sudo apt-get install -y pkg-config
3535
sudo apt update && \
36-
sudo DEBIAN_FRONTEND=noninteractive apt install -y build-essential cmake pkg-config libssl-dev libssh2-1-dev zlib1g-dev libhttp-parser-dev python3 wget tar git && \
36+
sudo DEBIAN_FRONTEND=noninteractive apt install -y build-essential cmake pkg-config libssl-dev libssh2-1-dev zlib1g-dev libhttp-parser-dev python3 wget tar git && \
37+
ORIGINAL_DIR=$(pwd) && \
38+
TEMP_BUILD_DIR="/tmp/libgit2_build_$$" && \
39+
mkdir -p "$TEMP_BUILD_DIR" && \
40+
cd "$TEMP_BUILD_DIR" && \
3741
wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.5.1.tar.gz -O libgit2-v1.5.1.tar.gz && \
3842
tar -xzf libgit2-v1.5.1.tar.gz && \
3943
cd libgit2-1.5.1 && \
@@ -42,7 +46,8 @@ jobs:
4246
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF && \
4347
make -j$(nproc) && \
4448
sudo make install && \
45-
sudo ldconfig
49+
sudo ldconfig && \
50+
cd "$ORIGINAL_DIR"
4651
env:
4752
LIBGIT2_SYS_USE_PKG_CONFIG: "1"
4853

.goreleaser.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ release:
55
before:
66
hooks:
77
- go mod download
8+
- ./hack/build-libgit2.sh
9+
810

911
builds:
1012
- main: main.go
@@ -15,7 +17,7 @@ builds:
1517
- darwin
1618
goarch:
1719
- amd64
18-
- arm64
20+
# - arm64
1921
env:
2022
- CGO_ENABLED=1
2123
ldflags:

hack/build-libgit2.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
3+
sudo apt-get update
4+
sudo apt-get install -y pkg-config
5+
sudo apt update && \
6+
sudo DEBIAN_FRONTEND=noninteractive apt install -y build-essential cmake pkg-config libssl-dev libssh2-1-dev zlib1g-dev libhttp-parser-dev python3 wget tar git && \
7+
wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.5.1.tar.gz -O libgit2-v1.5.1.tar.gz && \
8+
tar -xzf libgit2-v1.5.1.tar.gz && \
9+
cd libgit2-1.5.1 && \
10+
mkdir build && \
11+
cd build && \
12+
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF && \
13+
make -j$(nproc) && \
14+
sudo make install && \
15+
sudo ldconfig

0 commit comments

Comments
 (0)