Skip to content

Commit

Permalink
chore(ci): Fix release workflow (#204)
Browse files Browse the repository at this point in the history
As expected, I didn't get this right on the first try. This is mostly a
few fixups plus getting a cast fro Linux on arm64 correct.
  • Loading branch information
davisp authored Feb 24, 2025
1 parent 6ac41e6 commit b279ec7
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- "dynamic"
os:
- "ubuntu-latest"
# - "linux-arm64-ubuntu24"
- "linux-arm64-ubuntu24"
- "macos-13"
- "macos-latest"
runs-on: ${{ matrix.os }}
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ jobs:
lint:
name: "Lint - Stable"
runs-on: ubuntu-latest
strategy:
matrix:
os:
- "ubuntu-latest"
- "linux-arm64-ubuntu24"
- "macos-13"
- "macos-latest"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout tiledb-rs
uses: actions/checkout@v4
Expand All @@ -57,7 +64,14 @@ jobs:
lint-nightly:
name: "Lint - Nightly"
continue-on-error: true
runs-on: ubuntu-latest
strategy:
matrix:
os:
- "ubuntu-latest"
- "linux-arm64-ubuntu24"
- "macos-13"
- "macos-latest"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout tiledb-rs
uses: actions/checkout@v4
Expand All @@ -76,6 +90,7 @@ jobs:

check-pr-title:
name: "Check Title Format"
if: ${{ github.ref != 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- name: "Check Title Format"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Nightly CI
name: Release
on:
workflow_dispatch:
push:
Expand Down
1 change: 1 addition & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ which just means you get to skip a few chore steps.
1. Create a new `release-x.y` branch
2. Perform any maintenance actions
3. Run `./scripts/make-release.sh`
4. When the Release workflow succeeds, publish the release using the GitHub UI

### 1. Create a new `release-x.y` Branch

Expand Down
2 changes: 1 addition & 1 deletion scripts/make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
NOTES=$(git cliff --unreleased --tag $1)
git tag -a --cleanup verbatim -e -m "$NOTES" $1
git push origin $1
gh release create $1 --verify-tag --notes "$NOTES"
gh release create $1 --draft --verify-tag --notes "$NOTES"
13 changes: 10 additions & 3 deletions tiledb/api/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,16 @@ impl TDBString {
};

if res == ffi::TILEDB_OK {
let raw_slice: &[u8] = unsafe {
std::slice::from_raw_parts(c_str as *const u8, c_len)
};
// The type of `c_str` is platform dependent which means that we
// have to cast anything that might use i8 to u8. However, this
// means that platforms (i.e., Ubuntu arm64) that have a u8
// c_char type will generate a clippy error about an unnecessary
// cast from u8 to u8. Hence why we're ignoring the lint here.
#[allow(clippy::unnecessary_cast)]
let c_u8_str = c_str as *const u8;

let raw_slice: &[u8] =
unsafe { std::slice::from_raw_parts(c_u8_str, c_len) };
match std::str::from_utf8(raw_slice) {
Ok(s) => Ok(s.to_owned()),
Err(e) => Err(Error::NonUtf8(raw_slice.to_vec(), e)),
Expand Down

0 comments on commit b279ec7

Please sign in to comment.