Skip to content

Commit 6382826

Browse files
committed
Use GitVersionTask to version assemblies instead of github actions
Fixes #51
1 parent fe9417c commit 6382826

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

.github/workflows/dotnetcore.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ jobs:
1919
uses: actions/checkout@v2
2020
- name: Fetch all history for all tags and branches
2121
run: git fetch --prune --unshallow
22-
- name: Install GitVersion
23-
uses: gittools/actions/gitversion/[email protected]
24-
with:
25-
versionSpec: '5.1.x'
26-
- name: Use GitVersion
27-
id: gitversion # step id used as reference for output values
28-
uses: gittools/actions/gitversion/[email protected]
2922
- name: Setup .NET Core
3023
uses: actions/setup-dotnet@v1
3124
with:
@@ -35,13 +28,13 @@ jobs:
3528
- name: Restore dependencies
3629
run: dotnet restore
3730
- name: Build source code
38-
run: dotnet build --configuration Release --no-restore -property:Version=${{ steps.gitversion.outputs.semVer }}
31+
run: dotnet build --configuration Release --no-restore
3932
- name: Test with dotnet
4033
run: dotnet test --configuration Release --no-build
4134
- name: Check source file format
4235
run: dotnet format --folder . --check --dry-run # --folder is used to supress warnings: https://github.com/dotnet/format/issues/584
4336
- name: Pack
44-
run: dotnet pack --output ./artifacts --configuration Release --no-build -property:Version=${{ steps.gitversion.outputs.semVer }}
37+
run: dotnet pack --output ./artifacts --configuration Release --no-build
4538
- uses: actions/upload-artifact@v1
4639
with:
4740
name: artifacts

Directory.Build.targets

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project>
2+
<ItemGroup>
3+
<PackageReference Include="GitVersionTask" Version="5.3.6">
4+
<PrivateAssets>all</PrivateAssets>
5+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
6+
</PackageReference>
7+
</ItemGroup>
8+
</Project>

GitVersion.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
branches:
2+
master:
3+
tag: beta

0 commit comments

Comments
 (0)