Skip to content

Commit

Permalink
Make: Upgrade CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ashvardanian committed Mar 16, 2024
1 parent 2cc246b commit 7eb51e8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/Dockerfile.libs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@ RUN apt-get update && \
ENV CC=gcc-12
ENV CXX=g++-12

COPY . .
# Copy only the parts we need to build the library.
COPY CMakeLists.txt CMakeLists.txt
COPY include/ include/
COPY c/ c/
COPY VERSION VERSION

# As we are building from inside the container, the "main project" resolution
# may not work as expected, so override `STRINGZILLA_BUILD_SHARED=1`.
RUN cmake -DCMAKE_BUILD_TYPE=Release -DSTRINGZILLA_BUILD_SHARED=1 -B ./build_release
RUN cmake -DCMAKE_BUILD_TYPE=Release \
-DSTRINGZILLA_BUILD_SHARED=1 \
-DSTRINGZILLA_BUILD_BENCHMARK=0 \
-DSTRINGZILLA_BUILD_TEST=0 \
-B ./build_release
RUN cmake --build ./build_release --config Release --target stringzillite

RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
Expand All @@ -35,4 +43,4 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
cp ./build_release/libstringzillite.so stringzillite_linux_"$arch"_"$version"/usr/local/lib/ && \
echo "Package: stringzilla\nVersion: $version\nMaintainer: Ash Vardanian\nArchitecture: "$arch"\nDescription: SIMD-accelerated string search, sort, hashes, fingerprints, & edit distances" > stringzillite_linux_"$arch"_"$version"/DEBIAN/control && \
dpkg-deb --build stringzillite_linux_"$arch"_"$version" && \
sshpass -p "$user_pass" scp -o StrictHostKeyChecking=no stringzillite_linux_"$arch"_"$version".deb "$user_name"@"$docker_ip":/home/$user_name/work/stringzilla/stringzilla/
sshpass -p "$user_pass" scp -o StrictHostKeyChecking=no stringzillite_linux_"$arch"_"$version".deb "$user_name"@"$docker_ip":/home/$user_name/work/stringzilla/
27 changes: 9 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Release"
name: Release

on:
push:
Expand All @@ -21,7 +21,7 @@ jobs:
name: Semantic Release
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Node.js
Expand Down Expand Up @@ -160,18 +160,17 @@ jobs:
matrix:
arch: ["linux/amd64", "linux/arm64"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
ref: "main"
- run: git submodule update --init --recursive

- name: Setup QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Setup Docker
uses: docker/setup-buildx-action@v2

uses: docker/setup-buildx-action@v3
- name: Get Docker daemon IP
id: dockerip
run: |
Expand All @@ -193,7 +192,7 @@ jobs:
--build-arg docker_ip=${{ steps.dockerip.outputs.docker_ip }} \
--build-arg user_pass=${{ steps.userpass.outputs.user_pass }} \
--file .github/workflows/Dockerfile.libs \
--tag unum/stringzillite-library:latest \
--tag ashvardanian/stringzillite-library:latest \
--load .
- name: Clear Docker buildx cache
run: docker buildx prune --all --force
Expand All @@ -215,7 +214,7 @@ jobs:
matrix:
arch: [x64, x86]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
ref: "main"
Expand All @@ -224,10 +223,6 @@ jobs:
- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v1.13

- uses: actions/setup-go@v4
with:
go-version: "^1.19.0"

- name: Setup MinGW
uses: egor-tensin/setup-mingw@v2
with:
Expand Down Expand Up @@ -264,16 +259,12 @@ jobs:
matrix:
arch: [arm64, x86_64]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
ref: "main"
- run: git submodule update --init --recursive

- uses: actions/setup-go@v4
with:
go-version: "^1.21.0"

- name: Get version
id: version
run: |
Expand All @@ -284,7 +275,7 @@ jobs:
run: |
cmake -DCMAKE_BUILD_TYPE=Release -B ./build_release
cmake --build ./build_release --config Release
zip -r stringzillite_macOS_${{ matrix.arch }}_${{ steps.version.outputs.version }}.zip build_release/libstringzillite.dylib include/stringzilla/stringzilla.h
zip -r stringzillite_macos_${{ matrix.arch }}_${{ steps.version.outputs.version }}.zip build_release/libstringzillite.dylib include/stringzilla/stringzilla.h
- name: Upload archive
uses: xresloader/upload-to-github-release@v1
Expand Down
1 change: 1 addition & 0 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"conanfile.py",
"package.json",
"Cargo.toml",
"Cargo.lock",
"CMakeLists.txt",
"include/stringzilla/stringzilla.h"
],
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7eb51e8

Please sign in to comment.