diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dd10a54..4a57d61 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,11 +23,14 @@ jobs: - build_script: build_mv3_chrome - build_script: build_mv3_safari steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 + cache: 'npm' - name: Install dependencies run: npm ci @@ -35,9 +38,11 @@ jobs: - name: Linter run: npm run lint - - name: Set BETA environment variable + - name: Set BETA environment variables if: startsWith(github.ref, 'refs/tags/v') != true - run: echo "BETA=true" >> $GITHUB_ENV + run: | + echo "BETA=true" >> $GITHUB_ENV + echo "GIT_REV_COUNT=`git rev-list --all --count`" >> $GITHUB_ENV - name: Build run: npm run ${{ matrix.build_script }} diff --git a/package-lock.json b/package-lock.json index 435b55e..690e1ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "iitc-button", - "version": "3.0.3", + "version": "3.0.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "iitc-button", - "version": "3.0.3", + "version": "3.0.4", "license": "GPLv3", "dependencies": { "@highlightjs/vue-plugin": "^1.0.2", diff --git a/package.json b/package.json index 3a3fc71..b5a6dd6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iitc-button", - "version": "3.0.3", + "version": "3.0.4", "repository": "https://github.com/IITC-CE/IITC-Button.git", "license": "GPLv3", "private": true, diff --git a/vue.config.js b/vue.config.js index abcd8fa..6451313 100644 --- a/vue.config.js +++ b/vue.config.js @@ -12,14 +12,8 @@ const manifest_transformer = (manifest) => { manifest.icons["48"] = "assets/icons/48/icon-beta.png"; manifest.icons["128"] = "assets/icons/128/icon-beta.png"; - let currentDate = new Date(); - let year = String(currentDate.getFullYear()).slice(-2); - let month = String(currentDate.getMonth() + 1).padStart(2, "0"); - let day = String(currentDate.getDate()).padStart(2, "0"); - let hours = String(currentDate.getHours()).padStart(2, "0"); - - let formattedDate = `${year}${month}${day}${hours}`; - manifest.version = `${manifest.version}.${formattedDate}`; + const git_rev_count = parseInt(process.env.GIT_REV_COUNT) % 65535; + manifest.version = `${manifest.version}.${git_rev_count}`; } if (manifest_version === "2") {