Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
87264b0
[bfops/release-ci]: WIP
bfops Apr 18, 2025
b6089a9
[bfops/release-ci]: done?
bfops Apr 18, 2025
f94ef31
[bfops/release-ci]: fix?
bfops Apr 18, 2025
62692e3
[bfops/release-ci]: warnings
bfops Apr 18, 2025
b2148a9
[bfops/release-ci]: fix?
bfops Apr 18, 2025
babb996
[bfops/release-ci]: Merge remote-tracking branch 'origin/master' into…
bfops Apr 18, 2025
582d552
[bfops/release-ci]: try more platforms
bfops Apr 18, 2025
74b5fe7
[bfops/release-ci]: fix?
bfops Apr 18, 2025
a3cc510
[bfops/release-ci]: fix arm?
bfops Apr 18, 2025
4a9eecc
[bfops/release-ci]: fix?
bfops Apr 18, 2025
4e5bc16
[bfops/release-ci]: fix?
bfops Apr 18, 2025
2921040
[bfops/release-ci]: review
bfops Apr 18, 2025
a847a9d
[bfops/release-ci]: fix runner name
bfops Apr 18, 2025
32939aa
[bfops/release-ci]: retry on http failures
bfops Apr 18, 2025
13972ac
[bfops/release-ci]: fix on MacOS
bfops Apr 18, 2025
b446c8a
[bfops/release-ci]: fail install when getting a failure
bfops Apr 18, 2025
03bc93d
[bfops/release-ci]: try fix loop
bfops Apr 18, 2025
cb3d6e4
[bfops/release-ci]: maybe fix?
bfops Apr 18, 2025
8c9b1b1
[bfops/release-ci]: fix
bfops Apr 18, 2025
d0d0a87
[bfops/release-ci]: set -eu
bfops Apr 18, 2025
7e9a5c1
[bfops/release-ci]: lints
bfops Apr 18, 2025
1f2ef02
[bfops/release-ci]: remove loop
bfops Apr 18, 2025
d31c5a5
[bfops/release-ci]: empty
bfops Apr 18, 2025
ebd90ab
[bfops/release-ci]: remove set
bfops Apr 18, 2025
9880ac4
[bfops/release-ci]: print headers on failure
bfops Apr 18, 2025
e72ea81
[bfops/release-ci]: more debug output
bfops Apr 18, 2025
0dcb333
[bfops/release-ci]: try GITHUB_TOKEN
bfops Apr 18, 2025
dd1aa80
[bfops/release-ci]: fix env
bfops Apr 18, 2025
a057b82
[bfops/release-ci]: use github token in CI
bfops Apr 18, 2025
32a925e
[bfops/release-ci]: fix
bfops Apr 18, 2025
882d2d7
[bfops/release-ci]: review
bfops Apr 18, 2025
ab85721
[bfops/release-ci]: revert
bfops Apr 18, 2025
7e6a9e3
[bfops/release-ci]: review
bfops Apr 18, 2025
a8fcf77
[bfops/release-ci]: review
bfops Apr 18, 2025
e3395a1
[bfops/release-ci]: review
bfops Apr 18, 2025
c205216
[bfops/release-ci]: review
bfops Apr 19, 2025
8b4365c
[bfops/release-ci]: replace shell
bfops Apr 19, 2025
0732a86
[bfops/release-ci]: review
bfops Apr 19, 2025
bac5868
[bfops/release-ci]: review
bfops Apr 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,44 @@ jobs:

- name: Run bindgen tests
run: cargo test -p spacetimedb-cli

update:
name: Test spacetimedb-update flow
permissions: read-all
strategy:
matrix:
include:
- { target: x86_64-unknown-linux-gnu, runner: spacetimedb-runner }
- { target: aarch64-unknown-linux-gnu, runner: arm-runner }
- { target: aarch64-apple-darwin, runner: macos-latest }
- { target: x86_64-pc-windows-msvc, runner: windows-latest }
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Rust
uses: dsherret/rust-toolchain-file@v1

- name: Install rust target
run: rustup target add ${{ matrix.target }}

- name: Install packages
if: ${{ matrix.runner == 'arm-runner' }}
shell: bash
run: sudo apt install libssl-dev

- name: Build spacetimedb-update
run: cargo build --features github-token-auth --target ${{ matrix.target }} -p spacetimedb-update

- name: Run self-install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
ROOT_DIR="$(mktemp -d)"
# NOTE(bfops): We need the `github-token-auth` feature because we otherwise tend to get ratelimited when we try to fetch `/releases/latest`.
# My best guess is that, on the GitHub runners, the "anonymous" ratelimit is shared by *all* users of that runner (I think this because it
# happens very frequently on the `macos-runner`, but we haven't seen it on any others).
cargo run --features github-token-auth --target ${{ matrix.target }} -p spacetimedb-update -- self-install --root-dir="${ROOT_DIR}" --yes
"${ROOT_DIR}"/spacetime --root-dir="${ROOT_DIR}" help
5 changes: 5 additions & 0 deletions crates/update/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ rust-version.workspace = true
license-file = "LICENSE"
publish = false

[features]
# NOTE(bfops): This is not a well-thought-through feature. It's really only meant for internal testing/debugging.
# Specifically, we use it in some CI.
github-token-auth = []

[dependencies]
spacetimedb-paths.workspace = true

Expand Down
16 changes: 13 additions & 3 deletions crates/update/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,19 @@ enum VersionSubcommand {
}

fn reqwest_client() -> anyhow::Result<reqwest::Client> {
Ok(reqwest::Client::builder()
.user_agent(format!("SpacetimeDB CLI/{}", env!("CARGO_PKG_VERSION")))
.build()?)
let mut client = reqwest::Client::builder();
#[cfg(feature = "github-token-auth")]
{
use reqwest::header;
if let Ok(token) = std::env::var("GITHUB_TOKEN") {
eprintln!("HTTP requests will use the GITHUB_TOKEN from your environment");
let mut headers = header::HeaderMap::new();
headers.insert(header::AUTHORIZATION, format!("Bearer {}", token).parse().unwrap());
client = client.default_headers(headers);
}
}
client = client.user_agent(format!("SpacetimeDB CLI/{}", env!("CARGO_PKG_VERSION")));
Ok(client.build()?)
}

fn tokio_block_on<Fut: Future>(fut: Fut) -> anyhow::Result<Fut::Output> {
Expand Down
Loading