aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/release.yaml4
-rw-r--r--xtask/src/dist.rs10
2 files changed, 10 insertions, 4 deletions
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 96b9a85be..0434b6128 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -71,7 +71,7 @@ jobs:
71 with: 71 with:
72 node-version: 12.x 72 node-version: 12.x
73 73
74 - run: echo "::set-env name=TAG::$(date --iso)" 74 - run: echo "::set-env name=TAG::$(date --iso --utc)"
75 if: github.event_name == 'push' 75 if: github.event_name == 'push'
76 - run: echo "::set-env name=TAG::nightly" 76 - run: echo "::set-env name=TAG::nightly"
77 if: github.event_name == 'schedule' 77 if: github.event_name == 'schedule'
@@ -108,4 +108,4 @@ jobs:
108 if: github.event_name == 'push' 108 if: github.event_name == 'push'
109 working-directory: ./editors/code 109 working-directory: ./editors/code
110 # token from https://dev.azure.com/rust-analyzer/ 110 # token from https://dev.azure.com/rust-analyzer/
111 run: npx vsce publish 0.1.$(date +%Y%m%d) --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer.vsix 111 run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer.vsix
diff --git a/xtask/src/dist.rs b/xtask/src/dist.rs
index d42faa122..bb3593b11 100644
--- a/xtask/src/dist.rs
+++ b/xtask/src/dist.rs
@@ -27,7 +27,13 @@ fn dist_client(nightly: bool) -> Result<()> {
27 let _restore = 27 let _restore =
28 Restore { path: package_json_path.clone(), contents: original_package_json.clone() }; 28 Restore { path: package_json_path.clone(), contents: original_package_json.clone() };
29 29
30 let mut package_json = original_package_json.replace(r#""enableProposedApi": true,"#, r#""#); 30 let date = run!("date --utc +%Y%m%d")?;
31 let version_suffix = if nightly { "-nightly" } else { "" };
32
33 let mut package_json = original_package_json.replace(
34 r#""version": "0.2.20200211-dev""#,
35 &format!(r#""version": "0.1.{}{}""#, date, version_suffix),
36 );
31 37
32 if nightly { 38 if nightly {
33 package_json = package_json.replace( 39 package_json = package_json.replace(
@@ -35,7 +41,7 @@ fn dist_client(nightly: bool) -> Result<()> {
35 r#""displayName": "rust-analyzer nightly""#, 41 r#""displayName": "rust-analyzer nightly""#,
36 ); 42 );
37 } else { 43 } else {
38 package_json = original_package_json.replace(r#""enableProposedApi": true,"#, r#""#); 44 package_json = package_json.replace(r#""enableProposedApi": true,"#, r#""#);
39 } 45 }
40 fs2::write(package_json_path, package_json)?; 46 fs2::write(package_json_path, package_json)?;
41 47