Skip to content

Commit a12517f

Browse files
authored
Merge pull request #92 from dolittle/add-version-info
Add VersionInfo class and workflow step.
2 parents 4d65572 + 1b72c7b commit a12517f

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

.github/workflows/workflow.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,12 @@ jobs:
2222
with:
2323
node-version: 12.x
2424
registry-url: 'https://registry.npmjs.org'
25-
- run: yarn
26-
- run: yarn ci
2725

2826
- name: Establish context
2927
id: context
3028
uses: dolittle/establish-context-action@v2
3129
with:
3230
prerelease-branches: ${{ env.PRERELEASE_BRANCHES }}
33-
3431
- name: Increment version
3532
id: increment-version
3633
if: ${{ steps.context.outputs.should-publish == 'true' }}
@@ -39,6 +36,15 @@ jobs:
3936
version: ${{ steps.context.outputs.current-version }}
4037
release-type: ${{ steps.context.outputs.release-type }}
4138

39+
- name: Update VersionInfo
40+
uses: dolittle/update-version-info-action@v1
41+
with:
42+
version: ${{ steps.increment-version.outputs.next-version || '0.0.0-prerelease' }}
43+
files-to-update: Source/sdk/VersionInfo.ts
44+
45+
- run: yarn
46+
- run: yarn ci
47+
4248
- name: Prepend to Changelog
4349
if: ${{ steps.context.outputs.should-publish == 'true' && steps.context.outputs.release-type != 'prerelease' }}
4450
uses: dolittle/add-to-changelog-action@v2

Source/sdk/VersionInfo.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright (c) Dolittle. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
import { Version } from '@dolittle/sdk.execution';
5+
6+
/**
7+
* Provides information about the current version of the Dolittle JS SDK version.
8+
*/
9+
export class VersionInfo {
10+
/**
11+
* Gets the current {@link Version} of the Dolittle JS SDK.
12+
*/
13+
static get currentVersion(): Version {
14+
return new Version(377, 389, 368, 0, 'PRERELEASE');
15+
}
16+
}

0 commit comments

Comments
 (0)