diff options
author | Aleksey Kladov <[email protected]> | 2020-03-23 13:33:44 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-03-23 13:33:44 +0000 |
commit | 59f6bf87d651d987be63941d42999ac205f891b2 (patch) | |
tree | 22d845c4bd45bf9dab8a11c735cbb27042006653 | |
parent | f8fd242199bb5cb41ab2579548b89dbfe6af94c2 (diff) |
Fix release
-rw-r--r-- | .github/workflows/release.yaml | 10 | ||||
-rw-r--r-- | xtask/src/dist.rs | 11 | ||||
-rw-r--r-- | xtask/src/main.rs | 14 |
3 files changed, 25 insertions, 10 deletions
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index df34dfdb8..fb9e207b1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml | |||
@@ -49,11 +49,15 @@ jobs: | |||
49 | node-version: 12.x | 49 | node-version: 12.x |
50 | 50 | ||
51 | - name: Dist | 51 | - name: Dist |
52 | if: github.ref == 'refs/heads/release' | 52 | if: matrix.os == 'ubuntu-latest' && github.ref == 'refs/heads/release' |
53 | run: cargo xtask dist --version 0.2.$GITHUB_RUN_NUMBER --tag $(date --iso --utc) | 53 | run: cargo xtask dist --client --version 0.2.$GITHUB_RUN_NUMBER --tag $(date --iso --utc) |
54 | 54 | ||
55 | - name: Dist | 55 | - name: Dist |
56 | if: github.ref != 'refs/heads/release' | 56 | if: matrix.os == 'ubuntu-latest' && github.ref == 'refs/heads/release' |
57 | run: cargo xtask dist --client --version 0.3.$GITHUB_RUN_NUMBER-nightly --tag nightly | ||
58 | |||
59 | - name: Dist | ||
60 | if: matrix.os != 'ubuntu-latest' | ||
57 | run: cargo xtask dist --version 0.3.$GITHUB_RUN_NUMBER-nightly --tag nightly | 61 | run: cargo xtask dist --version 0.3.$GITHUB_RUN_NUMBER-nightly --tag nightly |
58 | 62 | ||
59 | - name: Upload artifacts | 63 | - name: Upload artifacts |
diff --git a/xtask/src/dist.rs b/xtask/src/dist.rs index 2002d3e2a..78dea08e7 100644 --- a/xtask/src/dist.rs +++ b/xtask/src/dist.rs | |||
@@ -7,13 +7,18 @@ use crate::{ | |||
7 | project_root, | 7 | project_root, |
8 | }; | 8 | }; |
9 | 9 | ||
10 | pub fn run_dist(version: &str, release_tag: &str) -> Result<()> { | 10 | pub struct ClientOpts { |
11 | pub version: String, | ||
12 | pub release_tag: String, | ||
13 | } | ||
14 | |||
15 | pub fn run_dist(client_opts: Option<ClientOpts>) -> Result<()> { | ||
11 | let dist = project_root().join("dist"); | 16 | let dist = project_root().join("dist"); |
12 | rm_rf(&dist)?; | 17 | rm_rf(&dist)?; |
13 | fs2::create_dir_all(&dist)?; | 18 | fs2::create_dir_all(&dist)?; |
14 | 19 | ||
15 | if cfg!(target_os = "linux") { | 20 | if let Some(ClientOpts { version, release_tag}) = client_opts { |
16 | dist_client(version, release_tag)?; | 21 | dist_client(&version, &release_tag)?; |
17 | } | 22 | } |
18 | dist_server()?; | 23 | dist_server()?; |
19 | Ok(()) | 24 | Ok(()) |
diff --git a/xtask/src/main.rs b/xtask/src/main.rs index aafa73610..b1a56b67f 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs | |||
@@ -13,7 +13,7 @@ use std::env; | |||
13 | use pico_args::Arguments; | 13 | use pico_args::Arguments; |
14 | use xtask::{ | 14 | use xtask::{ |
15 | codegen::{self, Mode}, | 15 | codegen::{self, Mode}, |
16 | dist::run_dist, | 16 | dist::{ClientOpts, run_dist}, |
17 | install::{ClientOpt, InstallCmd, ServerOpt}, | 17 | install::{ClientOpt, InstallCmd, ServerOpt}, |
18 | not_bash::pushd, | 18 | not_bash::pushd, |
19 | pre_commit, project_root, run_clippy, run_fuzzer, run_pre_cache, run_release, run_rustfmt, | 19 | pre_commit, project_root, run_clippy, run_fuzzer, run_pre_cache, run_release, run_rustfmt, |
@@ -103,10 +103,16 @@ FLAGS: | |||
103 | run_release(dry_run) | 103 | run_release(dry_run) |
104 | } | 104 | } |
105 | "dist" => { | 105 | "dist" => { |
106 | let version: String = args.value_from_str("--version")?; | 106 | let client_opts = if args.contains("--client") { |
107 | let release_tag: String = args.value_from_str("--tag")?; | 107 | Some(ClientOpts { |
108 | version: args.value_from_str("--version")?, | ||
109 | release_tag: args.value_from_str("--tag")?, | ||
110 | }) | ||
111 | } else { | ||
112 | None | ||
113 | }; | ||
108 | args.finish()?; | 114 | args.finish()?; |
109 | run_dist(&version, &release_tag) | 115 | run_dist(client_opts) |
110 | } | 116 | } |
111 | _ => { | 117 | _ => { |
112 | eprintln!( | 118 | eprintln!( |