-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* xtask: - improve cross-compatibility, - remove build stage in `package` and `install`, - add npm ci stage to `package` and `install` - add args `package` and `install` * ci/cd: draft-release action
- Loading branch information
1 parent
b9b4da0
commit 3586abe
Showing
11 changed files
with
141 additions
and
73 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
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,48 @@ | ||
name: draft-release | ||
|
||
on: | ||
push: | ||
tags: '*' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
release: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
include: | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup npm | ||
uses: actions/setup-node@v4 | ||
- name: Setup rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: ${{ matrix.target }} | ||
override: true | ||
|
||
- name: Build xtask | ||
run: cargo build --package xtask --target ${{ matrix.target }} --release | ||
- name: Prepare and pack the client | ||
run: | | ||
cargo xtask prep-lsp --target ${{ matrix.target }} --release | ||
cargo xtask package --out-dir . --out-name "witcherscript-ide-${{ github.ref_name }}-${{ matrix.target }}" | ||
- name: Create draft release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "*.vsix" | ||
draft: true | ||
allowUpdates: true | ||
generateReleaseNotes: true |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
mod copy_lsp; | ||
mod copy_lsp_release; | ||
mod prep_lsp; | ||
mod package; | ||
mod install; | ||
|
||
pub use copy_lsp::copy_lsp; | ||
pub use copy_lsp_release::copy_lsp_release; | ||
pub use prep_lsp::prep_lsp; | ||
pub use package::package; | ||
pub use install::install; |
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,42 @@ | ||
use std::path::PathBuf; | ||
use xshell::{Shell, cmd}; | ||
|
||
|
||
const LSP_DST: &str = "./editors/vscode/server/bin"; | ||
|
||
pub fn prep_lsp(release: bool, target: Option<String>) -> anyhow::Result<()> { | ||
let sh = Shell::new()?; | ||
|
||
let mut build = cmd!(sh, "cargo build --package witcherscript-lsp"); | ||
|
||
let mut lsp_src = PathBuf::from("./target"); | ||
if let Some(target) = target { | ||
build = build.arg("--target").arg(&target); | ||
lsp_src.push(target); | ||
} | ||
|
||
if release { | ||
build = build.arg("--release"); | ||
lsp_src.push("release"); | ||
} else { | ||
lsp_src.push("debug"); | ||
} | ||
|
||
lsp_src.push("witcherscript-lsp"); | ||
|
||
if cfg!(windows) { | ||
lsp_src.set_extension("exe"); | ||
} | ||
|
||
println!("Building the LSP..."); | ||
build.run()?; | ||
|
||
|
||
// make sure destination folder exists | ||
sh.create_dir(LSP_DST)?; | ||
|
||
sh.copy_file(lsp_src, LSP_DST)?; | ||
println!("Copied LSP into {}", LSP_DST); | ||
|
||
Ok(()) | ||
} |
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