Skip to content

Commit

Permalink
generate schema in workflows (#125)
Browse files Browse the repository at this point in the history
* generate schema in workflows

* fix windows build

* compress schema output in release mode
  • Loading branch information
blake-mealey authored Feb 1, 2022
1 parent b98f56d commit 3a7b2b4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ jobs:
run: |
cargo fmt -- --check
cargo clippy -- -D warnings
- name: Generate schema
run: cargo run --bin schema
17 changes: 12 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
with:
filename: mantle-win64.zip
path: target/release/mantle.exe
- name: Upload artifacts
- name: Upload binary artifact
uses: actions/upload-artifact@v2
with:
name: mantle-win64
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
with:
filename: mantle-macos.zip
path: target/release/mantle
- name: Upload artifacts
- name: Upload binary artifact
uses: actions/upload-artifact@v2
with:
name: mantle-macos
Expand All @@ -85,24 +85,31 @@ jobs:
with:
filename: mantle-linux.zip
path: target/release/mantle
- name: Upload artifacts
- name: Upload binary artifact
uses: actions/upload-artifact@v2
with:
name: mantle-linux
path: mantle-linux.zip
- name: Generate schema
run: cargo run --bin schema > schema.json
- name: Upload schema artifact
uses: actions/upload-artifact@v2
with:
name: schema
path: schema.json
release:
runs-on: ubuntu-latest
needs: [windows, macos, linux]
steps:
- name: Download binaries
uses: actions/download-artifact@v2
with:
path: binaries
path: artifacts
- name: Create release
uses: softprops/action-gh-release@v1
with:
# TODO: remove and add body_path once we have an automated release notes generator
draft: true
# TODO: remove once we reach a stable version
prerelease: true
files: binaries/*/*
files: artifacts/*/*
2 changes: 1 addition & 1 deletion src/lib/roblox_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn get_roblosecurity_from_roblox_studio() -> Option<String> {
.ok()?;
let value: String = key.get_value(".ROBLOSECURITY").ok()?;

parse_roblosecurity_from_roblox_studio(value)
parse_roblosecurity_from_roblox_studio(&value)
}

#[cfg(target_os = "macos")]
Expand Down
4 changes: 4 additions & 0 deletions src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,9 @@ fn main() {
.into_generator()
.into_root_schema_for::<Config>();

#[cfg(debug_assertions)]
println!("{}", serde_json::to_string_pretty(&schema).unwrap());

#[cfg(not(debug_assertions))]
println!("{}", serde_json::to_string(&schema).unwrap());
}

0 comments on commit 3a7b2b4

Please sign in to comment.