-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d622788
commit 0eedacb
Showing
5 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters