Skip to content

Commit 568fb87

Browse files
authored
Improve version number derivation (#3822)
1 parent 39cd50b commit 568fb87

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/nightly-publish.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,22 @@ jobs:
3838
cache: 'pnpm'
3939
- name: Install dependencies
4040
run: pnpm install --frozen-lockfile
41-
- name: Count commits
42-
id: count
43-
run: echo "total=$(git rev-list --all --count)" >> $GITHUB_OUTPUT
41+
- name: Forge numeric Nightly version
42+
id: version
43+
env:
44+
RUN_NUMBER: ${{ github.run_number }}
45+
run: echo "number=$(( 5500 + ${RUN_NUMBER} ))" >> $GITHUB_OUTPUT
4446
- name: Patch package.json version
4547
env:
46-
COMMIT_COUNT: ${{ steps.count.outputs.total }}
48+
VERSION_NUMBER: ${{ steps.version.outputs.number }}
4749
run: |
4850
node <<'EOF'
4951
const fs = require('fs');
5052
const path = require('path');
5153
const pkgPath = path.join(__dirname, 'apps', 'vscode-nightly', 'package.nightly.json');
5254
const pkg = JSON.parse(fs.readFileSync(pkgPath,'utf8'));
5355
const [maj, min] = pkg.version.split('.');
54-
pkg.version = `${maj}.${min}.${process.env.COMMIT_COUNT}`;
56+
pkg.version = `${maj}.${min}.${process.env.VERSION_NUMBER}`;
5557
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
5658
console.log(`🔖 Nightly version set to ${pkg.version}`);
5759
EOF

0 commit comments

Comments
 (0)