File tree 2 files changed +29
-11
lines changed
2 files changed +29
-11
lines changed Original file line number Diff line number Diff line change 4
4
push :
5
5
6
6
env :
7
- STACKS_BLOCKCHAIN_COMMIT : ecfe80bf16cfe60ef6e68aa30e9b3f8d7b18e268
7
+ STACKS_BLOCKCHAIN_COMMIT : " 2.1.0.0.0 "
8
8
9
9
jobs :
10
10
cancel-previous-runs :
@@ -45,13 +45,21 @@ jobs:
45
45
sudo apt-get install -y g++-aarch64-linux-gnu libc6-dev-arm64-cross gcc-aarch64-linux-gnu
46
46
- name : Fetch Stacks node repo
47
47
if : steps.cache.outputs.cache-hit != 'true'
48
+ env :
49
+ BLOCKCHAIN_REPO : https://github.com/stacks-network/stacks-blockchain.git
48
50
run : |
49
51
echo "$PWD"
50
52
mkdir stacks-blockchain-repo && cd stacks-blockchain-repo
51
- git init
52
- git remote add origin https://github.com/stacks-network/stacks-blockchain.git
53
- git -c protocol.version=2 fetch --depth=1 origin $STACKS_BLOCKCHAIN_COMMIT
54
- git reset --hard FETCH_HEAD
53
+ if git ls-remote -htq --exit-code $BLOCKCHAIN_REPO $STACKS_BLOCKCHAIN_COMMIT; then
54
+ echo "Cloning Stacks blockchain from branch or tag: $STACKS_BLOCKCHAIN_COMMIT"
55
+ git clone --depth 1 --branch "$STACKS_BLOCKCHAIN_COMMIT" "$BLOCKCHAIN_REPO" .
56
+ else
57
+ echo "Cloning Stacks blockchain from commit: $STACKS_BLOCKCHAIN_COMMIT"
58
+ git init
59
+ git remote add origin $BLOCKCHAIN_REPO
60
+ git -c protocol.version=2 fetch --depth=1 origin $STACKS_BLOCKCHAIN_COMMIT
61
+ git reset --hard FETCH_HEAD
62
+ fi
55
63
- name : Rust cache
56
64
if : steps.cache.outputs.cache-hit != 'true'
57
65
uses : Swatinem/rust-cache@v2
Original file line number Diff line number Diff line change 2
2
3
3
FROM rust:bullseye as builder
4
4
5
- ARG GIT_COMMIT=ecfe80bf16cfe60ef6e68aa30e9b3f8d7b18e268
5
+ # A commit hash, tag, or branch
6
+ ARG GIT_COMMIT=2.1.0.0.0
7
+ ARG BLOCKCHAIN_REPO=https://github.com/stacks-network/stacks-blockchain.git
8
+
6
9
ARG TARGETPLATFORM
7
10
ENV DEBIAN_FRONTEND noninteractive
8
11
@@ -23,11 +26,18 @@ RUN <<EOF
23
26
mkdir -p target/release && mv "$STACKS_NODE_BIN_AMD64" target/release/stacks-node
24
27
exit 0
25
28
fi
26
- echo "Building stacks-node from commit: https://github.com/stacks-network/stacks-blockchain/commit/$GIT_COMMIT"
27
- git init
28
- git remote add origin https://github.com/stacks-network/stacks-blockchain.git
29
- git -c protocol.version=2 fetch --depth=1 origin "$GIT_COMMIT"
30
- git reset --hard FETCH_HEAD
29
+
30
+ if git ls-remote -htq --exit-code $BLOCKCHAIN_REPO $GIT_COMMIT; then
31
+ echo "Cloning Stacks blockchain from branch or tag: $GIT_COMMIT"
32
+ git clone --depth 1 --branch "$GIT_COMMIT" "$BLOCKCHAIN_REPO" .
33
+ else
34
+ echo "Cloning Stacks blockchain from commit: $GIT_COMMIT"
35
+ git init
36
+ git remote add origin $BLOCKCHAIN_REPO
37
+ git -c protocol.version=2 fetch --depth=1 origin $GIT_COMMIT
38
+ git reset --hard FETCH_HEAD
39
+ fi
40
+
31
41
CARGO_NET_GIT_FETCH_WITH_CLI=true cargo build --package stacks-node --bin stacks-node --release
32
42
EOF
33
43
You can’t perform that action at this time.
0 commit comments