Skip to content

Commit

Permalink
crates io
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmindlin committed Jul 10, 2024
1 parent d622788 commit 0eedacb
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 6 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/crates-io.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: crates.io

on:
push:
tags:
- "**[0-9]+.[0-9]+.[0-9]+*"
pull_request:

jobs:
push_to_crates_io:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ repository = "https://github.com/maxmindlin/scout-lang"

[dependencies]
futures = "0.3.30"
scout-interpreter = { path = "./scout-interpreter/" }
scout-lexer = { path = "./scout-lexer/" }
scout-parser = { path = "./scout-parser/" }
scout-interpreter = { version = "0.5.1", path = "./scout-interpreter/" }
scout-lexer = { version = "0.5.1", path = "./scout-lexer/" }
scout-parser = { version = "0.5.1", path = "./scout-parser/" }
rustyline = "8.0.0"
colored = "2"
fantoccini = "0.19.3"
Expand Down
31 changes: 31 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
use core::panic;
use std::path::Path;
use std::{env, fs, io};

fn copy_dir_all(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> io::Result<()> {
fs::create_dir_all(&dst)?;
for entry in fs::read_dir(src)? {
let entry = entry?;
let ty = entry.file_type()?;
if ty.is_dir() {
copy_dir_all(entry.path(), dst.as_ref().join(entry.file_name()))?;
} else {
let content = fs::read_to_string(entry.path())?;
fs::write(dst.as_ref().join(entry.file_name()), content)?;
}
}
Ok(())
}

fn main() {
println!("cargo::rerun-if-changed=scout-lib/");
let scout_dir = match env::var("SCOUT_PATH") {
Ok(s) => Path::new(&s).to_path_buf(),
Err(_) => match env::var("HOME") {
Ok(s) => Path::new(&s).join("scout-lang"),
Err(_) => panic!("Unable to find $HOME or $SCOUT_PATH. Please set one."),
},
};
let path = scout_dir.join("scout-lib").to_owned();
copy_dir_all("scout-lib", path).unwrap();
}
4 changes: 2 additions & 2 deletions scout-interpreter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
scout-parser = { path = "../scout-parser/" }
scout-parser = { version = "0.5.1", path = "../scout-parser/" }
fantoccini = "0.19.3"
futures = "0.3.30"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
image = "0.25.1"
scout-lexer = { path = "../scout-lexer/" }
scout-lexer = { version = "0.5.1", path = "../scout-lexer/" }
url = "2.5.2"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion scout-parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
scout-lexer = { path = "../scout-lexer/" }
scout-lexer = { version = "0.5.1", path = "../scout-lexer/" }

[dev-dependencies]
test-case = "*"

0 comments on commit 0eedacb

Please sign in to comment.