Skip to content

Commit

Permalink
chore(ci): Fix release workflow
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 committed Feb 24, 2025
1 parent 6ac41e6 commit 88521a2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,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 88521a2

Please sign in to comment.