File tree Expand file tree Collapse file tree 2 files changed +22
-11
lines changed Expand file tree Collapse file tree 2 files changed +22
-11
lines changed Original file line number Diff line number Diff line change 2121jobs :
2222 format-build-test :
2323 runs-on : ubicloud
24- timeout-minutes : 45
24+ timeout-minutes : 15
2525 steps :
2626 - name : Check out
27- uses : actions/checkout@v2
27+ uses : actions/checkout@v4
28+ with :
29+ fetch-depth : 0
2830 - name : Config rust toolchain
2931 run : |
3032 rustup update stable && rustup default stable
31- rustup component add rustfmt
3233 rustup show active-toolchain
33- rustup install 1.76.0-x86_64-unknown-linux-gnu
3434 - name : Format
3535 run : cargo fmt --all -- --check
3636 - name : install libdrift_ffi_sys
3737 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/
4040 - uses : ubicloud/rust-cache@v2
4141 with :
4242 path : |
Original file line number Diff line number Diff line change @@ -2,8 +2,9 @@ name: Release
22
33on :
44 push :
5- branches :
6- - " master"
5+ tags :
6+ - ' v*.*.*'
7+
78env :
89 REGISTRY : ghcr.io
910 IMAGE_NAME : ${{ github.repository }}
@@ -18,13 +19,23 @@ jobs:
1819 timeout-minutes : 45
1920 steps :
2021 - name : Check out
21- uses : actions/checkout@v2
22+ uses : actions/checkout@v4
23+ with :
24+ fetch-depth : 0
2225 - name : Build image
2326 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+
2536 docker build -f Dockerfile .\
2637 -t "${REGISTRY}/${IMAGE_NAME}:${GITHUB_SHA::6}"\
27- -t "${REGISTRY}/${IMAGE_NAME}:${VERSION_TAG }"\
38+ -t "${REGISTRY}/${IMAGE_NAME}:${TAG_VERSION }"\
2839 -t "${REGISTRY}/${IMAGE_NAME}:latest"
2940 env :
3041 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments