File tree 6 files changed +27
-5
lines changed
6 files changed +27
-5
lines changed Original file line number Diff line number Diff line change 22
22
node-version : ' 22'
23
23
cache : ' npm'
24
24
25
+ - name : Version
26
+ run : |
27
+ BASE_VERSION=$(npm run get-version --silent)
28
+ # Remove last digit and dot, then append run number
29
+ VERSION=$(echo $BASE_VERSION | sed 's/\.[0-9]*$/.'${{ github.run_number }}/)
30
+ echo "VERSION=$VERSION" >> $GITHUB_ENV
31
+ shell : bash
32
+
33
+ - name : Update package.json version
34
+ run : npm version $VERSION --no-git-tag-version
35
+ shell : bash
36
+
25
37
- name : Install dependencies
26
38
run : npm ci
27
39
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " angor-profile" ,
3
- "version" : " 0.0 .0" ,
3
+ "version" : " 0.1 .0" ,
4
4
"scripts" : {
5
5
"ng" : " ng" ,
6
6
"start" : " ng serve" ,
7
7
"build" : " ng build" ,
8
8
"watch" : " ng build --watch --configuration development" ,
9
- "test" : " ng test"
9
+ "test" : " ng test" ,
10
+ "get-version" : " node -p \" require('./package.json').version\" "
10
11
},
11
12
"private" : true ,
12
13
"dependencies" : {
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { Component } from '@angular/core';
2
2
import { RouterOutlet , RouterLink } from '@angular/router' ;
3
3
import { CommonModule } from '@angular/common' ;
4
4
import { ThemeService } from './services/theme.service' ;
5
+ import { environment } from '../environment' ;
5
6
6
7
@Component ( {
7
8
selector : 'app-root' ,
@@ -80,7 +81,7 @@ import { ThemeService } from './services/theme.service';
80
81
</div>
81
82
</div>
82
83
<div class="footer-bottom">
83
- <p>© 2024 Angor Profile. All rights reserved.</p>
84
+ <p>© 2024 Angor Profile. All rights reserved. Version {{ version }}. </p>
84
85
</div>
85
86
</footer>
86
87
` ,
@@ -226,6 +227,8 @@ import { ThemeService } from './services/theme.service';
226
227
export class AppComponent {
227
228
title = 'angor-profile' ;
228
229
230
+ version = environment . appVersion
231
+
229
232
constructor ( public themeService : ThemeService ) { }
230
233
231
234
toggleTheme ( ) {
Original file line number Diff line number Diff line change
1
+ import { version } from '../package.json' ;
2
+
3
+ export const environment = {
4
+ appVersion : version ,
5
+ } ;
Original file line number Diff line number Diff line change 16
16
"moduleResolution" : " bundler" ,
17
17
"importHelpers" : true ,
18
18
"target" : " ES2022" ,
19
- "module" : " ES2022"
19
+ "module" : " ES2022" ,
20
+ "resolveJsonModule" : true
20
21
},
21
22
"angularCompilerOptions" : {
22
23
"enableI18nLegacyMessageIdFormat" : false ,
You can’t perform that action at this time.
0 commit comments