fix: make build process work
Some checks failed
Build BAB Application Deployment Artifact / build (push) Failing after 2m6s

This commit is contained in:
2024-06-24 07:25:59 -04:00
parent c08fa6c2d8
commit 998c88d783
4 changed files with 10 additions and 16 deletions

View File

@@ -8,6 +8,8 @@ on:
jobs: jobs:
build: build:
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
steps: steps:
- name: Checkout - name: Checkout
@@ -33,9 +35,10 @@ jobs:
- name: Build and Release - name: Build and Release
id: build id: build
run: | run: |
npm run semantic-version npx semantic-release
env: env:
GT_TOKEN: ${{ secrets.GT_TOKEN }} GITEA_TOKEN: ${{ secrets.GT_TOKEN }}
GITEA_URL: ${{ vars.GT_URL }}
- name: Trigger Ansible Deploy Playbook - name: Trigger Ansible Deploy Playbook
uses: https://github.com/distributhor/workflow-webhook@v3 uses: https://github.com/distributhor/workflow-webhook@v3
with: with:

View File

@@ -12,7 +12,7 @@
[ [
"@semantic-release/exec", "@semantic-release/exec",
{ {
"prepareCmd": "quasar build -m pwa", "prepareCmd": "npm run generate-version '${nextRelease.version}' && quasar build -m pwa",
"publishCmd": "tar -czvf release-${nextRelease.version}.tar.gz dist/pwa && echo '::set-output name=VERSION::${nextRelease.version}'" "publishCmd": "tar -czvf release-${nextRelease.version}.tar.gz dist/pwa && echo '::set-output name=VERSION::${nextRelease.version}'"
} }
], ],

View File

@@ -1,19 +1,10 @@
const { execSync } = require('child_process');
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
try { try {
// Run semantic-release to get the next version number const version = process.argv[2];
const dryRunOutput = execSync('npx semantic-release --dry-run').toString();
// Extract the version number from the semantic-release output if (!version) throw Error('Must pass version on command line');
const versionMatch = dryRunOutput.match(
/The next release version is ([\S]+)/
);
if (!versionMatch) {
throw new Error('Version number not found in semantic-release output');
}
const version = versionMatch[1];
// Create version content // Create version content
const versionContent = `export const APP_VERSION = '${version}';\n`; const versionContent = `export const APP_VERSION = '${version}';\n`;

View File

@@ -10,8 +10,8 @@
"lint": "eslint --ext .js,.ts,.vue ./", "lint": "eslint --ext .js,.ts,.vue ./",
"format": "prettier --write \"**/*.{js,ts,vue,scss,html,md,json}\" --ignore-path .gitignore", "format": "prettier --write \"**/*.{js,ts,vue,scss,html,md,json}\" --ignore-path .gitignore",
"test": "echo \"No test specified\" && exit 0", "test": "echo \"No test specified\" && exit 0",
"dev": "npm run generate-version && quasar dev", "dev": "npm run generate-version && quasar dev -m pwa",
"build": "npm run generate-version && quasar build" "build": "npm run generate-version && quasar build -m pwa"
}, },
"dependencies": { "dependencies": {
"@quasar/extras": "^1.16.11", "@quasar/extras": "^1.16.11",