Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend build fix #340

Merged
merged 20 commits into from
Oct 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
trying adding github info from workflow file
zachsents authored Oct 24, 2024
commit e490119bbd67562d226716d8ad85155814249c9a
Original file line number Diff line number Diff line change
@@ -17,15 +17,14 @@ jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
container:
image: ubuntu:latest
options: --user 1001
name: Build and Deploy Job
steps:
- uses: actions/checkout@v3
with:
submodules: true
lfs: false
- name: Write version file
run: npm run gitversion -- ${{ github.sha }} ${{ github.head_ref }}
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
9 changes: 6 additions & 3 deletions SBOLCanvasFrontend/git.version.ts
Original file line number Diff line number Diff line change
@@ -5,9 +5,12 @@ import * as child from 'child_process';
const exec = promisify(child.exec);

async function createVersionsFile(filename: string) {
const revision = (await exec('git rev-parse --short HEAD')).stdout.toString().trim();
const branch = (await exec('git rev-parse --abbrev-ref HEAD')).stdout.toString().trim();
let version = (await exec('git tag --points-at HEAD')).stdout.toString().trim();
const revision = process.argv[2]
?? (await exec('git rev-parse --short HEAD')).stdout.toString().trim();
const branch = process.argv[3]
??(await exec('git rev-parse --abbrev-ref HEAD')).stdout.toString().trim();
let version = process.env.npm_package_version
?? (await exec('git tag --points-at HEAD')).stdout.toString().trim();

if(version == ''){
version = 'Latest';
2 changes: 1 addition & 1 deletion SBOLCanvasFrontend/package.json
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
"version": "0.0.0",
"scripts": {
"bundle-report": "ng build --configuration production --stats-json && webpack-bundle-analyzer dist/SBOLCanvasFrontend/stats.json",
"prebuild": "npm rebuild sass && node assetBundler.js && bash ./write-version-file.sh",
"prebuild": "npm rebuild sass && node assetBundler.js",
"build": "ng build --configuration production --base-href=/canvas/",
"predev": "npm run prebuild",
"dev": "ng serve -o",