Skip to content

Commit 9f8306e

Browse files
committed
version test
1 parent 0913516 commit 9f8306e

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ jobs:
1919
npm i
2020
version=`git describe --tags`
2121
sed -i "s/0.0.0-version-placeholder/$version/g" ./projects/sim-api/package.json
22-
npm run -- ng build SimApi -c production --define SimApiVersion=$version
22+
sed -i "s/0.0.0/$version/g" ./projects/sim-api/src/version.ts
23+
npm run -- ng build SimApi -c production
2324
npm publish ./dist/sim-api --access public
2425
env:
2526
NODE_AUTH_TOKEN: ${{secrets.NPM_APIKEY}}

projects/sim-api/src/lib/simapi.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import {Injectable} from '@angular/core';
22
import {HttpClient, HttpHeaders} from '@angular/common/http';
33
import {Observable} from 'rxjs';
44
import {SimApiConfigService} from './simapi-config.service';
5+
import {SimApiVersion} from "../version";
56

67
type Callback = {
78
[key in number | string]: (data: any) => void | any;
89
};
910

10-
declare const SimApiVersion: string;
1111
declare const AppVersion: string;
1212

1313
@Injectable({
@@ -30,7 +30,7 @@ export class SimApiService {
3030

3131
get versions() {
3232
return {
33-
AppVersion: AppVersion,
33+
AppVersion: AppVersion ?? '0.0.0',
3434
SimApiVersion: SimApiVersion
3535
}
3636
}

projects/sim-api/src/public-api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ export * from './lib/simapi.service';
55
export * from './lib/simapi-auth.service';
66
export * from './lib/simapi.module';
77
export * from './lib/simapi-config.service';
8+
export * from './version';

projects/sim-api/src/version.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const SimApiVersion = '0.0.0';

0 commit comments

Comments
 (0)