Skip to content

Commit

Permalink
chore(release): Initial Release Workflow (#202)
Browse files Browse the repository at this point in the history
* chore(release): Create new release workflow

The initial scaffolding for creating and running the release workflows.

* Update workflows for releases

* Update install action to autodetect version

This now automatically pulls the version of libtiledb to use from
Cargo.toml.
  • Loading branch information
davisp authored Feb 24, 2025
1 parent acd6036 commit 6ac41e6
Show file tree
Hide file tree
Showing 9 changed files with 277 additions and 39 deletions.
33 changes: 26 additions & 7 deletions .github/actions/install-tiledb/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ description: Install TileDB
inputs:
version:
description: "The version of TileDB to install"
required: true
required: false
linkage:
description: "Whether to dynamically or statically link TileDB"
required: true
required: false
default: dynamic
platform:
description: "Override automatica platform detection."
description: "Override automatic platform detection."
required: false

runs:
Expand All @@ -22,6 +23,24 @@ runs:
- name: Install Requests
run: pip install requests
shell: bash
- name: Detect Version
id: version
env:
TDB_VERSION: ${{ inputs.version }}
shell: python
run: |
import json
import os
import subprocess as sp
version = os.environ["TDB_VERSION"]
if not version.strip():
data = sp.check_output("cargo metadata --format-version 1", shell=True)
data = json.loads(data)
version = data["metadata"]["libtiledb"]["version"]
with open(os.environ["GITHUB_OUTPUT"], 'w') as handle:
handle.write("version={}\n".format(version))
- name: Detect Platform
id: platform
env:
Expand All @@ -47,9 +66,9 @@ runs:
handle.write("platform={}\n".format(platform))
- name: Locate Upstream TileDB Tarball
id: upstream-tarball
if: ${{ inputs.version != 'main' && inputs.linkage != 'static' }}
if: ${{ steps.version.outputs.version != 'main' && inputs.linkage != 'static' }}
env:
TDB_VERSION: ${{ inputs.version }}
TDB_VERSION: ${{ steps.version.outputs.version }}
TDB_LINKAGE: ${{ inputs.linkage }}
TDB_PLATFORM: ${{ steps.platform.outputs.platform }}
shell: python
Expand Down Expand Up @@ -83,9 +102,9 @@ runs:
handle.write("sha256={}\n".format(candidates[0][1]))
- name: Locate Custom TileDB Tarball
id: custom-tarball
if: ${{ inputs.version == 'main' || inputs.linkage == 'static' }}
if: ${{ steps.version.outputs.version == 'main' || inputs.linkage == 'static' }}
env:
TDB_VERSION: ${{ inputs.version }}
TDB_VERSION: ${{ steps.version.outputs.version }}
TDB_LINKAGE: ${{ inputs.linkage }}
TDB_PLATFORM: ${{ steps.platform.outputs.platform }}
shell: python
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/nightly-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
- name: Install TileDB
uses: ./.github/actions/install-tiledb
with:
version: "main"
linkage: ${{ matrix.linkage }}
- name: Install Rust ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@master
Expand Down
31 changes: 19 additions & 12 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ jobs:
uses: Swatinem/rust-cache@v2
- name: Install TileDB
uses: ./.github/actions/install-tiledb
with:
version: "main"
linkage: "dynamic"
- name: Build
run: cargo build --all-targets --all-features
- name: Test
Expand All @@ -52,9 +49,6 @@ jobs:
uses: Swatinem/rust-cache@v2
- name: Install TileDB
uses: ./.github/actions/install-tiledb
with:
version: "main"
linkage: "dynamic"
- name: Check Formatting
run: cargo fmt --quiet --check
- name: Lint
Expand All @@ -75,15 +69,31 @@ jobs:
uses: Swatinem/rust-cache@v2
- name: Install TileDB
uses: ./.github/actions/install-tiledb
with:
version: "main"
linkage: "dynamic"
- name: Check Formatting
run: cargo fmt --quiet --check
- name: Lint
run: cargo clippy --no-deps --all-targets --all-features -- -Dwarnings

check-pr-title:
name: "Check Title Format"
runs-on: ubuntu-latest
steps:
- name: "Check Title Format"
shell: python
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
import os
import re
PAT = re.compile(r"^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)")
if not PAT.match(os.environ["PR_TITLE"]):
print("The pull request title does not match Conventional Commits syntax")
print("See: https://www.conventionalcommits.org/en/v1.0.0/")
exit(1)
check-api-coverage:
name: "Check API Coverage"
runs-on: ubuntu-latest
steps:
- name: Checkout tiledb-rs
Expand All @@ -96,9 +106,6 @@ jobs:
run: cargo install cargo-expand
- name: Install TileDB
uses: ./.github/actions/install-tiledb
with:
version: "main"
linkage: "dynamic"
- name: Build API Coverage Tool
run: cd tools/api-coverage && cargo build
- name: Calculate Coverage
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Nightly CI
on:
workflow_dispatch:
push:
branches:
- main
- "release-*"
tags:
- "*"

jobs:
run:
name: "Prepare: ${{ matrix.os }}"
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
- name: Install TileDB
uses: ./.github/actions/install-tiledb
- name: Install Rust ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Check Formatting
run: cargo fmt --quiet --check
- name: Lint
run: cargo clippy --all-targets --all-features -- -Dwarnings
- name: Build
run: cargo build --all-targets --all-features
- name: Test
run: cargo test --all-targets --all-features

create_issue_on_fail:
permissions:
issues: write
runs-on: ubuntu-latest
needs: run
if: failure() || cancelled()
steps:
- uses: actions/checkout@v3
- name: Create Issue on Failure
uses: TileDB-Inc/github-actions/open-issue@main
with:
name: Release Workflow Failure
label: release-failure
assignee: davisp,rroelke
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 20 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,37 @@ edition = "2021"
rust-version = "1.80"
version = "0.1.0"

[workspace.metadata.libtiledb]
version = "main"

[workspace.dependencies]
anyhow = "1.0"
armerge = "2"
arrow = { version = "52.0.0", features = ["prettyprint"] }
arrow-schema = { version = "52.0.0" }
arrow-schema = "52.0.0"
bindgen = "0.70"
cells = { path = "test-utils/cells", version = "0.1.0" }
cells = { path = "test-utils/cells" }
cmake = "0.1"
itertools = "0"
num-traits = "0.2"
paste = "1.0"
proptest = { version = "1.0.0" }
pkg-config = "0.3.30"
proptest = "1.0.0"
regex = "1"
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["float_roundtrip"] }
signal = { path = "test-utils/signal", version = "0.1.0" }
strategy-ext = { path = "test-utils/strategy-ext", version = "0.1.0" }
signal = { path = "test-utils/signal" }
strategy-ext = { path = "test-utils/strategy-ext" }
tempfile = { version = "3" }
thiserror = { version = "1" }
tiledb-api = { path = "tiledb/api", version = "0.1.0" }
tiledb-common = { path = "tiledb/common", version = "0.1.0" }
tiledb-pod = { path = "tiledb/pod", version = "0.1.0" }
tiledb-proc-macro = { path = "tiledb/proc-macro", version = "0.1.0" }
tiledb-proptest-config = { path = "test-utils/proptest-config", version = "0.1.0" }
tiledb-sys = { path = "tiledb/sys", version = "0.1.0" }
tiledb-sys-cfg = { path = "tiledb/sys-cfg", version = "0.1.0" }
tiledb-sys-defs = { path = "tiledb/sys-defs", version = "0.1.0" }
tiledb-test-utils = { path = "tiledb/test-utils", version = "0.1.0" }
tiledb-utils = { path = "tiledb/utils", version = "0.1.0" }
pkg-config = "0.3.30"
uri = { path = "test-utils/uri", version = "0.1.0" }
tiledb-api = { path = "tiledb/api" }
tiledb-common = { path = "tiledb/common" }
tiledb-pod = { path = "tiledb/pod" }
tiledb-proc-macro = { path = "tiledb/proc-macro" }
tiledb-proptest-config = { path = "test-utils/proptest-config" }
tiledb-sys = { path = "tiledb/sys" }
tiledb-sys-cfg = { path = "tiledb/sys-cfg" }
tiledb-sys-defs = { path = "tiledb/sys-defs" }
tiledb-test-utils = { path = "tiledb/test-utils" }
tiledb-utils = { path = "tiledb/utils" }
uri = { path = "test-utils/uri" }
60 changes: 60 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# How to Create a Release

This document describes the process for creating a release of tiledb-rs. There
are two main workflows: major/minor releases and patch releases. The two are
basically identical other than patch releases skip a few extra maintenance
steps for the major/minor release types.

## Release Types

Given the semantic version `x.y.z`, if `x` or `y` have changed, you're working
on a major/minor release. If only `z` has chagned, then its a patch release
which just means you get to skip a few chore steps.

## Required Tooling

- [Git Cliff](https://git-cliff.org/)
- [GitHub CLI](https://cli.github.com/)

## Preparing a Major or Minor Release

1. Create a new `release-x.y` branch
2. Perform any maintenance actions
3. Run `./scripts/make-release.sh`

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

```bash
$ git checkout -b release-0.1 origin/main
```

### 2. Perform any maintenance actions

This section is a work in progress. So far the following steps should be
manually verified:

1. Ensure that the `workspace.metadata.libtiledb.version` key is correct in `Cargo.toml`
2. Something something, check MSVR maybe?

### 3. Tag the Release

The following command will perform four major actions:

1. Use `git cliff` to generate the release CHANGELOG
2. Open your editor to view the change log before creating the tag
3. Create and push the tag to Github
4. Create the GitHub release using the newly created tag

```bash
$ ./scripts/make-release.sh x.y.z
```

## Preparing a Patch Release

Preparing a patch release should just be a matter of running `make-release.sh`
on the release branch.

```bash
$ git checkout release-x.y
$ ./scripts/make-release.sh x.y.z
```
Loading

0 comments on commit 6ac41e6

Please sign in to comment.