From 7b0d0f159a7e365c18cbf85c4f42983c338aaa15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20Drwi=C4=99ga?= Date: Thu, 2 Jan 2025 08:18:18 +0100 Subject: [PATCH] Update version while deploying. (#17) * Update version while deploying. * shorten version. --- .github/workflows/deploy.yml | 2 ++ web/bump-version.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e799f0c..3dfd695 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -39,6 +39,8 @@ jobs: run: npm ci - name: Build run: npm run build + - name: Update version + run: npm run update-version - name: Setup Pages uses: actions/configure-pages@v4 - name: Upload artifact diff --git a/web/bump-version.js b/web/bump-version.js index f1d3b7f..243e84c 100644 --- a/web/bump-version.js +++ b/web/bump-version.js @@ -5,6 +5,6 @@ const metadata = JSON.parse(fs.readFileSync(META_FILE)); const packageJson = JSON.parse(fs.readFileSync('./package.json')); const hash = process.argv[2] || 'xxxxxx'; -metadata.version = `${packageJson.version}-${hash}`; +metadata.version = `${packageJson.version}-${hash.substring(0, 6)}`; fs.writeFileSync(META_FILE, JSON.stringify(metadata, null, 2));