Skip to content

Commit

Permalink
Fix CI on master
Browse files Browse the repository at this point in the history
  • Loading branch information
coolreader18 committed Jan 29, 2025
1 parent 696fa45 commit df6f161
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 136 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- master
- staging
- dev
- noa/fix-master-ci
tags:
- 'v*'

Expand Down
69 changes: 34 additions & 35 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Linux SpacetimeDB CLI
name: Build SpacetimeDB CLI

on:
push:
Expand All @@ -7,54 +7,53 @@ on:
branches:
- master
- release/*
- noa/fix-master-ci

jobs:
linux-amd64-cli:
runs-on: bare-metal
build-cli:
strategy:
fail-fast: false
matrix:
include:
- { target: x86_64-unknown-linux-gnu, runner: bare-metal }
- { target: aarch64-unknown-linux-gnu, runner: arm-runner }
- { target: aarch64-apple-darwin, runner: macos-latest }
- { target: x86_64-apple-darwin, runner: macos-latest }
- { target: x86_64-pc-windows-msvc, runner: windows-latest }

name: Build CLI for ${{ matrix.target }}
runs-on: ${{ matrix.runner }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Compile x86
run: |
export PATH=$HOME/.cargo/bin:$PATH
cargo build --release -p spacetimedb-cli
mkdir build
cp --sparse=never target/release/spacetime build/spacetime
cd build && tar -czf spacetime.linux-amd64.tar.gz spacetime
rm spacetime
- name: Show arch
run: uname -a

- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Install Rust
uses: dsherret/rust-toolchain-file@v1

- name: Upload to DO Spaces
uses: shallwefootball/s3-upload-action@master
with:
aws_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: ${{ vars.AWS_BUCKET }}
source_dir: build
endpoint: https://nyc3.digitaloceanspaces.com
destination_dir: ${{ steps.extract_branch.outputs.branch }}
- name: Install rust target
run: rustup target add ${{ matrix.target }}

linux-arm64-cli:
runs-on: arm-runner
- name: Compile
run: |
cargo build --release --target ${{ matrix.target }} -p spacetimedb-cli -p spacetimedb-standalone -p spacetimedb-update
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Package (unix)
if: ${{ runner.os != 'Windows' }}
run: |
mkdir build
cd target/${{matrix.target}}/release
tar -czf ../../../build/spacetime-${{matrix.target}}.tar.gz spacetimedb-{cli,standalone,update}
- name: Compile ARM64
- name: Package (windows)
if: ${{ runner.os == 'Windows' }}
run: |
export PATH=$HOME/.cargo/bin:$PATH
cargo build --release -p spacetimedb-cli
mkdir build
cp --sparse=never target/release/spacetime build/spacetime
cd build && tar -czf spacetime.linux-arm64.tar.gz spacetime
rm spacetime
cd target/${{matrix.target}}/release
7z a ../../../build/spacetime-${{matrix.target}}.zip spacetimedb-cli.exe spacetimedb-standalone.exe spacetimedb-update.exe
- name: Extract branch name
shell: bash
Expand Down
57 changes: 0 additions & 57 deletions .github/workflows/macos-build.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/windows-build.yml

This file was deleted.

4 changes: 2 additions & 2 deletions crates/standalone/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ RUN mkdir -p /stdb/data && ln -s /usr/src/app/crates/standalone/config.toml /std
ENV PATH="/usr/src/app/target/debug:${PATH}"

FROM debian as env-release
COPY --from=builder /usr/src/app/target/release/spacetimedb /usr/local/bin/
COPY --from=builder /usr/src/app/target/release/spacetimedb-standalone /usr/local/bin/
COPY --from=builder /usr/src/app/crates/standalone/config.toml /stdb/data/config.toml

FROM env-${CARGO_PROFILE}

EXPOSE 3000

ENV RUST_BACKTRACE=1
ENTRYPOINT ["spacetimedb", "--data-dir=/stdb/data", "--jwt-pub-key-path=/etc/spacetimedb/id_ecdsa.pub", "--jwt-priv-key-path=/etc/spacetimedb/id_ecdsa"]
ENTRYPOINT ["spacetimedb-standalone", "--data-dir=/stdb/data", "--jwt-pub-key-path=/etc/spacetimedb/id_ecdsa.pub", "--jwt-priv-key-path=/etc/spacetimedb/id_ecdsa"]
CMD ["start"]
2 changes: 1 addition & 1 deletion tools/merge-docker-images.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -e
set -ex

# Shorten the first argument (commit sha) to 7 chars
SHORT_SHA=${1:0:7}
Expand Down

0 comments on commit df6f161

Please sign in to comment.