Skip to content

Commit bf3eef8

Browse files
committed
Set extension version during release
1 parent 5770fa7 commit bf3eef8

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
with:
7272
node-version: 12.x
7373

74-
- run: echo "::set-env name=TAG::$(date --iso)"
74+
- run: echo "::set-env name=TAG::$(date --iso --utc)"
7575
if: github.event_name == 'push'
7676
- run: echo "::set-env name=TAG::nightly"
7777
if: github.event_name == 'schedule'
@@ -108,4 +108,4 @@ jobs:
108108
if: github.event_name == 'push'
109109
working-directory: ./editors/code
110110
# 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

xtask/src/dist.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,21 @@ fn dist_client(nightly: bool) -> Result<()> {
2727
let _restore =
2828
Restore { path: package_json_path.clone(), contents: original_package_json.clone() };
2929

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+
);
3137

3238
if nightly {
3339
package_json = package_json.replace(
3440
r#""displayName": "rust-analyzer""#,
3541
r#""displayName": "rust-analyzer nightly""#,
3642
);
3743
} else {
38-
package_json = original_package_json.replace(r#""enableProposedApi": true,"#, r#""#);
44+
package_json = package_json.replace(r#""enableProposedApi": true,"#, r#""#);
3945
}
4046
fs2::write(package_json_path, package_json)?;
4147

0 commit comments

Comments
 (0)