diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index ab0eac2..acb4b17 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -3,7 +3,8 @@ run-name: ${{ gitea.actor }} is building a BAB App artifact 🚀 on: push: branches: - - devel + - main + - alpha jobs: build: @@ -30,10 +31,13 @@ jobs: run: | /bin/cat .env.local - name: Build Project - run: quasar build -m pwa - - name: Get Version Number + run: npm run build + - name: Set VERSION from VERSION file id: get_version - run: echo "::set-output name=VERSION::$(node -p "require('./package.json').version")" + run: | + VERSION=$(cat VERSION) + echo "VERSION=$VERSION" + echo "::set-output name=VERSION::$VERSION" - name: Tarfile run: | cd dist/pwa diff --git a/.gitignore b/.gitignore index ad8aaf6..8d88443 100644 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,5 @@ yarn-error.log* .env* # version file -src/version.js \ No newline at end of file +src/version.js +VERSION diff --git a/generate-version.js b/generate-version.js index 3c94b3d..fc47481 100644 --- a/generate-version.js +++ b/generate-version.js @@ -17,9 +17,12 @@ try { // Create version content const versionContent = `export const APP_VERSION = '${version}';\n`; + const versionTxtFilePath = path.resolve(__dirname, './VERSION'); const versionFilePath = path.resolve(__dirname, 'src/version.js'); - // Write version to file + // Write version to TXT file + fs.writeFileSync(versionTxtFilePath, version, 'utf8'); + // Write version to js file fs.writeFileSync(versionFilePath, versionContent, 'utf8'); console.log(`Version file generated with version: ${version}`); } catch (error) {