Skip to content

Commit

Permalink
chore: simplify release ci and add descriptions to crates (#68)
Browse files Browse the repository at this point in the history
* chore: Add description to each crate config

Remove monovue in favor of monoverse

* ci: simplify release workflow and update dependencies

- Simplify release.yml by removing binary builds and uploads
- Add manual workflow trigger with publish option
- Update sysinfo dependency from 0.32 to 0.33
- Remove fixed version constraints in release-please config
  • Loading branch information
appcypher authored Dec 8, 2024
1 parent bd3252e commit be9cfc5
Show file tree
Hide file tree
Showing 21 changed files with 40 additions and 213 deletions.
192 changes: 20 additions & 172 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name: 🚀 Release Packages & Binaries
on:
push:
branches: [ main ]
workflow_dispatch:
inputs:
run_publish_release:
description: 'Publish release'
type: boolean
required: true
default: false

permissions:
contents: write
Expand All @@ -12,145 +19,30 @@ jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
release_tag: ${{ steps.release.outputs.release_tag }}
releases_created: ${{ steps.release.outputs.releases_created }}
prs_created: ${{ steps.release.outputs.prs_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- name: Setup release-please
uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
default-branch: main
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

build-release-macos-arm64:
needs: release-please
runs-on: macos-latest
if: ${{ needs.release-please.outputs.release_created }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install libkrun dependencies
run: |
brew update
brew tap slp/tap
brew install krunvm
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Build libkrun
run: |
./build_libkrun.sh --no-cleanup --force-build
- name: Build monocore
working-directory: monocore
run: |
sudo make build
- name: Rename binaries
run: |
mv monocore/target/release/monocore build/monocore-macos-arm64
mv monocore/target/release/monokrun build/monokrun-macos-arm64
for file in build/libkrun/libkrun*.dylib; do
mv "build/libkrun/$file" "build/$(echo "$file" | sed 's/libkrun/libkrun-macos-arm64/')"
done
for file in build/libkrunfw/libkrunfw*.dylib; do
mv "build/libkrunfw/$file" "build/$(echo "$file" | sed 's/libkrunfw/libkrunfw-macos-arm64/')"
done
- name: Cache libkrun
uses: actions/cache/save@v4
with:
path: |
build/monocore-macos-arm64
build/monokrun-macos-arm64
build/libkrun-macos-arm64*.dylib
build/libkrunfw-macos-arm64*.dylib
key: macos-arm64-monocore-${{ needs.release-please.outputs.release_tag }}

- name: Build monoutils-store
working-directory: monoutils-store
run: |
cargo build --release -p monoutils-store
- name: Build monofs
working-directory: monofs
- name: Check release status
run: |
cargo build --release -p monofs
build-release-linux-x86_64:
needs: release-please
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.release_created }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install libkrun dependencies
run: |
sudo apt-get update -qqy
sudo apt-get install -y jq libelf-dev build-essential flex bison libssl-dev libncurses5-dev python3-pip
pip3 install --user pyelftools
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Build libkrun
run: |
./build_libkrun.sh --no-cleanup --force-build
- name: Build monocore
working-directory: monocore
run: |
sudo make build
- name: Rename binaries
run: |
mv monocore/target/release/monocore build/monocore-linux-x86_64
mv monocore/target/release/monokrun build/monokrun-linux-x86_64
for file in build/libkrun/libkrun*.so*; do
mv "build/libkrun/$file" "build/$(echo "$file" | sed 's/libkrun/libkrun-linux-x86_64/')"
done
for file in build/libkrunfw/libkrunfw*.so*; do
mv "build/libkrunfw/$file" "build/$(echo "$file" | sed 's/libkrunfw/libkrunfw-linux-x86_64/')"
done
- name: Cache libkrun
uses: actions/cache/save@v4
with:
path: |
build/monocore-linux-x86_64
build/monokrun-linux-x86_64
build/libkrun-linux-x86_64*.so*
build/libkrunfw-linux-x86_64*.so*
key: linux-x86_64-monocore-${{ needs.release-please.outputs.release_tag }}

- name: Build monoutils-store
working-directory: monoutils-store
run: |
cargo build --release -p monoutils-store
- name: Build monofs
working-directory: monofs
run: |
cargo build --release -p monofs
echo "Release created: ${{ steps.release.outputs.releases_created }}"
echo "PRs created: ${{ steps.release.outputs.prs_created }}"
echo "monocore created: ${{ steps.release.outputs.monocore--releases_created }}"
echo "monofs created: ${{ steps.release.outputs.monofs--releases_created }}"
echo "monoutils-store created: ${{ steps.release.outputs.monoutils-store--releases_created }}"
publish-release:
needs:
- release-please
- build-release-macos-arm64
if: ${{ needs.release-please.outputs.release_created }}
if: ${{ needs.release-please.outputs.releases_created == 'true' || github.event.inputs.run_publish_release }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -161,7 +53,7 @@ jobs:
env:
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
run: |
cargo publish -p monoutils-store || exit 1
cargo publish -p monoutils-store
- name: Wait for crates.io index update
run: |
Expand All @@ -173,55 +65,11 @@ jobs:
env:
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
run: |
cargo publish -p monofs || exit 1
cargo publish -p monofs
- name: Publish monocore
working-directory: monocore
env:
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
run: |
cargo publish -p monocore || exit 1
upload-release:
needs:
- release-please
- build-release-macos-arm64
- build-release-linux-x86_64
- publish-release
if: ${{ needs.release-please.outputs.release_created }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Restore macOS arm64 cache
uses: actions/cache/restore@v4
with:
path: |
build/monocore-macos-arm64
build/monokrun-macos-arm64
build/libkrun-macos-arm64*.dylib
build/libkrunfw-macos-arm64*.dylib
key: macos-arm64-monocore-${{ needs.release-please.outputs.release_tag }}

- name: Restore Linux x86_64 cache
uses: actions/cache/restore@v4
with:
path: |
build/monocore-linux-x86_64
build/monokrun-linux-x86_64
build/libkrun-linux-x86_64*.so*
build/libkrunfw-linux-x86_64*.so*
key: linux-x86_64-monocore-${{ needs.release-please.outputs.release_tag }}

- name: Upload release
uses: softprops/action-gh-release@v2
with:
files: |
CHANGELOG.md
build/monocore-*
build/monokrun-*
build/libkrun-*
build/libkrunfw-*
tag_name: ${{ needs.release-please.outputs.release_tag }}
token: ${{ secrets.GITHUB_TOKEN }}
cargo publish -p monocore
8 changes: 2 additions & 6 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ members = [
"monoutils-raft",
"monoutils-store",
"monoutils-ucan",
"monovue",
]
resolver = "2"

Expand Down
1 change: 1 addition & 0 deletions monoagent/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "monoagent"
version = "0.1.0"
description = "`monoagent` is a collection of AI agents used by the monocore project."
license.workspace = true
repository.workspace = true
authors.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion monoagent/lib/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `monoagent` is an AI agent for the monocore project.
//! `monoagent` is a collection of AI agents used by the monocore project.
#![warn(missing_docs)]
#![allow(clippy::module_inception)]
Expand Down
1 change: 1 addition & 0 deletions monobase/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "monobase"
version = "0.1.0"
description = "`monobase` is a distributed, decentralized, secure multi-model database."
license.workspace = true
repository.workspace = true
authors.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion monocore/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "monocore"
version = "0.1.0"
description = "`monocore` is a secure MicroVM provisioning system for running untrusted code in isolated environments."
license.workspace = true
repository.workspace = true
authors.workspace = true
Expand Down Expand Up @@ -57,7 +58,7 @@ typed-builder.workspace = true
typed-path.workspace = true
uuid.workspace = true
xattr.workspace = true
sysinfo = "0.32"
sysinfo = "0.33"
nix = { version = "0.29", features = ["mount", "user", "fs"] }
tar = "0.4"
flate2 = "1.0"
Expand Down
1 change: 1 addition & 0 deletions monofs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "monofs"
version = "0.1.0"
description = "`monofs` is an immutable distributed file system."
license.workspace = true
repository.workspace = true
authors.workspace = true
Expand Down
1 change: 1 addition & 0 deletions monoutils-agent/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "monoutils-agent"
version = "0.1.0"
description = "`monoutils-agent` is a simple utility library for building AI agents."
license.workspace = true
repository.workspace = true
authors.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion monoutils-agent/lib/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `monoutils-agent` is a library for building AI agents.
//! `monoutils-agent` is a simple utility library for building AI agents.
#![warn(missing_docs)]
#![allow(clippy::module_inception)]
Expand Down
1 change: 1 addition & 0 deletions monoutils-did/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "monoutils-did"
version = "0.1.0"
description = "`monoutils-did` is a library for working with DID-Web-Key and DID-Key decentralized identifiers (DIDs) methods."
license.workspace = true
repository.workspace = true
authors.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion monoutils-did/lib/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `monoutils-did` is a library for working with DID-WebKey and DID-Key decentralized identifiers (DIDs).
//! `monoutils-did` is a library for working with DID-Web-Key and DID-Key decentralized identifiers (DIDs) methods.
#![warn(missing_docs)]
#![allow(clippy::module_inception)]
Expand Down
1 change: 1 addition & 0 deletions monoutils-raft/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "monoutils-raft"
version = "0.1.0"
description = "`monoutils-raft` is a library for extending applications with the Raft distributed consensus protocol."
license.workspace = true
repository.workspace = true
authors.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion monoutils-raft/lib/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `monoutils-raft` is a library for working with the Raft consensus algorithm.
//! `monoutils-raft` is a library for extending applications with the Raft distributed consensus protocol.
#![warn(missing_docs)]
#![allow(clippy::module_inception)]
Expand Down
1 change: 1 addition & 0 deletions monoutils-store/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "monoutils-store"
version = "0.1.0"
description = "`monoutils-store` is a library for working with IPLD content-addressed stores (CAS)."
license.workspace = true
repository.workspace = true
authors.workspace = true
Expand Down
1 change: 1 addition & 0 deletions monoutils-ucan/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "monoutils-ucan"
version = "0.1.0"
description = "`monoutils-ucan` is a library for capabilities-based security using User Controlled Authorization Networks (UCANs)."
license.workspace = true
repository.workspace = true
authors.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion monoutils-ucan/lib/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `monoutils-ucan` is a library for working with User Controlled Authorization Networks (UCANs).
//! `monoutils-ucan` is a library for capabilities-based security using User Controlled Authorization Networks (UCANs).
#![warn(missing_docs)]
#![allow(clippy::module_inception)]
Expand Down
13 changes: 0 additions & 13 deletions monovue/Cargo.toml

This file was deleted.

1 change: 0 additions & 1 deletion monovue/README.md

This file was deleted.

Loading

0 comments on commit be9cfc5

Please sign in to comment.