Skip to content

Commit

Permalink
Merge pull request #236 from kinode-dao/v0.7.4
Browse files Browse the repository at this point in the history
v0.7.4
  • Loading branch information
nick1udwig authored Sep 16, 2024
2 parents 79aafce + c8aa2e4 commit a995659
Show file tree
Hide file tree
Showing 14 changed files with 621 additions and 233 deletions.
106 changes: 106 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Deploy kit Create Release

on:
# Runs on pushes targeting prod or dev branches
push:
branches: ["master", "v*"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build_and_test:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up nvm, node, npm p0
run: |
echo "$HOME" >> $GITHUB_PATH
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
- name: Set up nvm, node, npm p1
run: |
source $NVM_DIR/nvm.sh
nvm install 20.0.0
nvm --version
- name: Set up cargo
run: |
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh
rustup update
cargo install wasm-tools
rustup install nightly
rustup target add wasm32-wasip1
rustup target add wasm32-wasip1 --toolchain nightly
cargo install cargo-wasi
#- name: Get latest release from foundry-rs/foundry
# id: get-latest-foundry-release
# uses: actions/github-script@v6
# with:
# script: |
# const repo = {
# owner: 'foundry-rs',
# repo: 'foundry',
# per_page: 1,
# page: 1,
# };
# const releases = await github.rest.repos.listReleases(repo);
# const preReleases = releases.data.filter(release => release.prerelease);

# // Sort pre-releases by created_at date in descending order
# preReleases.sort((a, b) => new Date(b.created_at) - new Date(a.created_at));

# if (preReleases.length === 0) {
# throw new Error('No pre-releases found');
# }

# const latestPreRelease = preReleases[0];
# const asset = latestPreRelease.assets.find(asset => asset.name.match(/foundry_nightly_linux_amd64\.tar\.gz/));

# if (!asset) {
# throw new Error('Asset not found');
# }
# return asset.browser_download_url;
# result-encoding: string
- name: Download the Foundry release
run: wget -q https://github.com/foundry-rs/foundry/releases/download/nightly-de596a4db781933f0c95805bd1c8c05e65f03d4f/foundry_nightly_linux_amd64.tar.gz -O foundry.tar.gz
#run: wget -q ${DOWNLOAD_URL} -O foundry.tar.gz
#env:
# DOWNLOAD_URL: ${{ steps.get-latest-foundry-release.outputs.result }}
- name: Untar the release
run: tar zxf foundry.tar.gz
- name: Add Foundry to path
run: echo "$PWD" >> $GITHUB_PATH

- name: Build the release
run: ./scripts/build-release.py
- name: Unzip the build output
run: unzip /tmp/kit-release/kit-x86_64-unknown-linux-gnu.zip

#- name: Get latest release from kinode-dao/kit
# id: get-latest-kinode-release
# uses: actions/github-script@v6
# with:
# script: |
# const repo = {
# owner: 'kinode-dao',
# repo: 'kinode',
# };
# const release = await github.rest.repos.getLatestRelease(repo);
# const asset = release.data.assets.find(asset => asset.name.match(/kinode-x86_64-unknown-linux-gnu\.zip/));
# if (!asset) {
# throw new Error('Asset not found');
# }
# return asset.browser_download_url;
# result-encoding: string
- name: Download the Kinode release
run: wget -q https://files.yael.solutions/240906/kinode-x86_64-unknown-linux-gnu-simulation-mode.zip -O kinode.zip
#run: wget -q ${DOWNLOAD_URL} -O kinode.zip
#env:
# DOWNLOAD_URL: ${{ steps.get-latest-kinode-release.outputs.result }}
- name: Unzip the Kinode release
run: unzip kinode.zip

- name: Run tests
run: |
{ ./kit t src/new/templates/tests.toml; } 2>&1
File renamed without changes.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kit"
version = "0.7.3"
version = "0.7.4"
edition = "2021"

[build-dependencies]
Expand Down
7 changes: 3 additions & 4 deletions src/boot_fake_node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,12 @@ pub fn get_platform_runtime_name(is_simulation_mode: bool) -> Result<String> {
// TODO: update when have binaries
let zip_name_midfix = match (os_name, architecture_name) {
("Linux", "x86_64") => "x86_64-unknown-linux-gnu",
("Linux", "aarch64") => "aarch64-unknown-linux-gnu",
("Darwin", "arm64") => "arm64-apple-darwin",
("Darwin", "x86_64") => "x86_64-apple-darwin",
_ => {
return Err(eyre!(
"OS/Architecture {}/{} not amongst pre-built [Linux/x86_64, Apple/arm64, Apple/x86_64].",
"OS/Architecture {}/{} not amongst pre-built [Linux/x86_64, Linux/aarch64, Apple/arm64, Apple/x86_64].",
os_name,
architecture_name,
).with_suggestion(|| "Use the `--runtime-path` flag to build a local copy of the https://github.com/kinode-dao/kinode repo")
Expand Down Expand Up @@ -311,9 +312,7 @@ pub async fn find_releases_with_asset_if_online(
fn get_local_versions_with_prefix(prefix: &str) -> Result<Vec<String>> {
let mut versions = Vec::new();

let path = Path::new(prefix)
.parent()
.ok_or_else(|| eyre!("couldnt find directory with local runtimes"))?;
let path = Path::new(KIT_CACHE);
for entry in fs::read_dir(&path)? {
let entry = entry?;
let path = entry.path();
Expand Down
Loading

0 comments on commit a995659

Please sign in to comment.