File tree 2 files changed +22
-11
lines changed
2 files changed +22
-11
lines changed Original file line number Diff line number Diff line change 21
21
jobs :
22
22
format-build-test :
23
23
runs-on : ubicloud
24
- timeout-minutes : 45
24
+ timeout-minutes : 15
25
25
steps :
26
26
- name : Check out
27
- uses : actions/checkout@v2
27
+ uses : actions/checkout@v4
28
+ with :
29
+ fetch-depth : 0
28
30
- name : Config rust toolchain
29
31
run : |
30
32
rustup update stable && rustup default stable
31
- rustup component add rustfmt
32
33
rustup show active-toolchain
33
- rustup install 1.76.0-x86_64-unknown-linux-gnu
34
34
- name : Format
35
35
run : cargo fmt --all -- --check
36
36
- name : install libdrift_ffi_sys
37
37
run : |
38
- curl -L https://github.com/user-attachments/files/17849111 /libdrift_ffi_sys.so.zip > ffi.zip && unzip ffi.zip
39
- sudo cp libdrift_ffi_sys.so /usr/ lib/
38
+ curl -L https://github.com/drift-labs/drift-ffi-sys/releases/download/v2.103.0 /libdrift_ffi_sys.so.zip > ffi.zip && unzip ffi.zip
39
+ sudo cp libdrift_ffi_sys.so /lib/
40
40
- uses : ubicloud/rust-cache@v2
41
41
with :
42
42
path : |
Original file line number Diff line number Diff line change @@ -2,8 +2,9 @@ name: Release
2
2
3
3
on :
4
4
push :
5
- branches :
6
- - " master"
5
+ tags :
6
+ - ' v*.*.*'
7
+
7
8
env :
8
9
REGISTRY : ghcr.io
9
10
IMAGE_NAME : ${{ github.repository }}
@@ -18,13 +19,23 @@ jobs:
18
19
timeout-minutes : 45
19
20
steps :
20
21
- name : Check out
21
- uses : actions/checkout@v2
22
+ uses : actions/checkout@v4
23
+ with :
24
+ fetch-depth : 0
22
25
- name : Build image
23
26
run : |
24
- VERSION_TAG=$(grep -Po -m1 '\d.\d.\d' Cargo.toml)
27
+ CARGO_VERSION=$(grep -Po '(?<=version = ")\d+\.\d+\.\d+' Cargo.toml)
28
+ TAG_VERSION=${GITHUB_REF#refs/tags/v}
29
+
30
+ if [ "$CARGO_VERSION" != "$TAG_VERSION" ]; then
31
+ echo "Version mismatch: Cargo.toml version ($CARGO_VERSION) doesn't match tag version ($TAG_VERSION)"
32
+ exit 1
33
+ fi
34
+ echo "Version $CARGO_VERSION matches tag"
35
+
25
36
docker build -f Dockerfile .\
26
37
-t "${REGISTRY}/${IMAGE_NAME}:${GITHUB_SHA::6}"\
27
- -t "${REGISTRY}/${IMAGE_NAME}:${VERSION_TAG }"\
38
+ -t "${REGISTRY}/${IMAGE_NAME}:${TAG_VERSION }"\
28
39
-t "${REGISTRY}/${IMAGE_NAME}:latest"
29
40
env :
30
41
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments