diff --git a/.gitea/workflows/Build-Rollout.yml b/.gitea/workflows/Build-Rollout.yml index 9d93037..5d6ac5e 100644 --- a/.gitea/workflows/Build-Rollout.yml +++ b/.gitea/workflows/Build-Rollout.yml @@ -6,11 +6,6 @@ on: permissions: contents: write -env: - VERSION_MAJOR: '1' - VERSION_MINOR: '1' - VERSION_PATCH: ${{ gitea.run_number }} - jobs: build: runs-on: ubuntu-latest @@ -33,8 +28,9 @@ jobs: run: npm ci - name: Set Release Version - id: version run: npm run version:place + env: + VERSION_PATCH: ${{ gitea.run_number }} - name: Export Release Version id: release_version diff --git a/set-version.js b/set-version.js index 7da8b6c..e230ac9 100644 --- a/set-version.js +++ b/set-version.js @@ -3,6 +3,8 @@ const fs = require('fs'); const lockFilePath = 'package-lock.json'; const packageFilePath = 'package.json'; const placeholderVersion = 'x.x.x'; +const versionMajor = 1; +const versionMinor = 2; const command = process.argv[2]; function readJson(path) { @@ -74,19 +76,14 @@ function fixPlaceholder() { } function getCiVersion() { - const major = process.env.VERSION_MAJOR; - const minor = process.env.VERSION_MINOR; const patch = process.env.VERSION_PATCH; - const segments = { major, minor, patch }; - for (const [name, value] of Object.entries(segments)) { - if (!/^\d+$/.test(value ?? '')) { - console.error(`Missing or invalid ${name} version segment: "${value ?? ''}"`); - process.exit(1); - } + if (!/^\d+$/.test(patch ?? '')) { + console.error(`Missing or invalid patch version segment: "${patch ?? ''}"`); + process.exit(1); } - return `${major}.${minor}.${patch}`; + return `${versionMajor}.${versionMinor}.${patch}`; } if (command === 'check-placeholder') {