diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index e41a3f9..24ab68b 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -44,8 +44,11 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '22.x'
+ - name: Build webapp
+ run: |
+ echo "Building ${{ env.APP }} ${{ needs.setenv.outputs.rorversion}} (${{ needs.setenv.outputs.shortsha}})"
- run: mv package.json package-backup.json
- - run: jq --arg rorversion $ROR_VERSION '.version = $rorversion' package-backup.json > package.json
+ - run: jq --arg rorversion ${{ needs.setenv.outputs.rorversion}} --arg shortsha ${{ needs.setenv.outputs.shortsha}} '.version = $rorversion | .commit = $shortsha' package-backup.json > package.json
- run: npm ci
- run: npm run build:prod
diff --git a/package.json b/package.json
index b985fb7..7592802 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,7 @@
{
"name": "ror-web",
"version": "0.1.0",
+ "commit": "FFFFFF",
"scripts": {
"ng": "ng",
"start": "ng serve --port 11000",
diff --git a/src/app/about/about.component.html b/src/app/about/about.component.html
index 924ffd1..a9eb29e 100644
--- a/src/app/about/about.component.html
+++ b/src/app/about/about.component.html
@@ -27,7 +27,7 @@
{{ 'pages.about.
{{ 'app.titleLong' | translate }} |
- {{ appVersion }} |
+ {{ appVersion }} ({{ commit }}) |
Api version |
diff --git a/src/app/about/about.component.ts b/src/app/about/about.component.ts
index b7b1639..76c1371 100644
--- a/src/app/about/about.component.ts
+++ b/src/app/about/about.component.ts
@@ -13,6 +13,7 @@ import { VersionService } from '../core/services/version.service';
})
export class AboutComponent implements OnInit {
appVersion = environment.appVersion;
+ commit = environment.commit;
health$: Observable | undefined;
healthError: any;
diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts
index b88bf26..41cf274 100644
--- a/src/environments/environment.prod.ts
+++ b/src/environments/environment.prod.ts
@@ -1,8 +1,9 @@
declare let require: any;
-const { version: appVersion } = require('../../package.json');
+const { version: appVersion, commit: commit } = require('../../package.json');
export const environment = {
appVersion,
+ commit,
configPath: 'assets/config/config.json',
production: true,
};
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index 5e3242d..b4ffddd 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -2,10 +2,11 @@
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
declare let require: any;
-const { version: appVersion } = require('../../package.json');
+const { version: appVersion, commit: commit } = require('../../package.json');
export const environment = {
appVersion,
+ commit,
production: false,
configPath: 'assets/config/config.json',
};