Skip to content

Commit

Permalink
chore: build without cross
Browse files Browse the repository at this point in the history
  • Loading branch information
ovr committed Apr 2, 2024
1 parent 3b36fe4 commit 30fb7d6
Showing 1 changed file with 72 additions and 4 deletions.
76 changes: 72 additions & 4 deletions .github/workflows/rust-cubestore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

cross:
cubestore:
runs-on: ${{ matrix.os }}
timeout-minutes: 90
env:
Expand Down Expand Up @@ -180,9 +180,6 @@ jobs:
workspaces: ./rust/cubestore -> target
prefix-key: v0-rust-cubestore-cross
key: target-${{ matrix.target }}
- run: source .github/actions/${{ matrix.before_script }}.sh
if: ${{ matrix.before_script }}
shell: bash
- uses: ilammy/msvc-dev-cmd@v1
if: ${{ startsWith(matrix.os, 'windows') }}
- name: Install OpenSSL for Windows
Expand Down Expand Up @@ -243,3 +240,74 @@ jobs:
path: cubestore-archive/cubestored-${{ matrix.target }}.tar.gz
name: cubestored-${{ matrix.target }}.tar.gz
retention-days: 1

cubestore_linux:
runs-on: ${{ matrix.os }}
timeout-minutes: 90
env:
RUSTFLAGS: '-Ctarget-feature=+crt-static'
OPENSSL_STATIC: 1
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- x86_64-pc-windows-msvc
- x86_64-apple-darwin
- aarch64-unknown-linux-gnu
include:
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
executable_name: cubestored
strip: true
compress: false
- os: ubuntu-22.04
target: x86_64-unknown-linux-musl
executable_name: cubestored
strip: true
# cubestored: CantPackException: bad DT_HASH nbucket=0x344 len=0x1890
compress: false
- os: ubuntu-22.04
target: aarch64-unknown-linux-gnu
executable_name: cubestored
# Unable to recognise the format of the input file `rust/cubestore/target/aarch64-unknown-linux-gnu/release/cubestored'
strip: false
# UPX is broken, issue https://github.com/cube-js/cube/issues/4474
compress: false
fail-fast: false
container:
image: cubejs/rust-cross:${{ matrix.target }}-02042024
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
workspaces: ./rust/cubestore -> target
prefix-key: v0-rust-cubestore-cross
key: target-${{ matrix.target }}
- name: Build with Cargo
run: |
cd rust/cubestore && cargo build --release --target=${{ matrix.target }}
- name: Compress binaries
uses: svenstaro/upx-action@v2
if: ${{ matrix.compress }}
with:
file: rust/cubestore/target/${{ matrix.target }}/release/${{ matrix.executable_name }}
args: --lzma
strip: ${{ matrix.strip }}
- name: Create folder for archive
run: |
mkdir cubestore-archive
mkdir cubestore-archive/bin
- name: Copy/paste OpenSSL to Archive (hotfix for Windows)
if: ${{ startsWith(matrix.os, 'windows') }}
run: cp C:/vcpkg/packages/openssl_x64-windows/bin/*.dll cubestore-archive/bin
- name: Create archive for release
run: |
mv rust/cubestore/target/${{ matrix.target }}/release/${{ matrix.executable_name }} cubestore-archive/bin/${{ matrix.executable_name }}
cd cubestore-archive
tar -cvzf cubestored-${{ matrix.target }}.tar.gz *
- uses: actions/upload-artifact@v2
with:
path: cubestore-archive/cubestored-${{ matrix.target }}.tar.gz
name: cubestored-${{ matrix.target }}.tar.gz
retention-days: 1

0 comments on commit 30fb7d6

Please sign in to comment.