Skip to content

Commit

Permalink
Use MinVer
Browse files Browse the repository at this point in the history
  • Loading branch information
JimBobSquarePants committed Jul 2, 2020
1 parent d49d552 commit 6521c1c
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 57 deletions.
43 changes: 5 additions & 38 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,15 @@ jobs:
git fetch --prune --unshallow
git submodule -q update --init --recursive
- name: Fetch Tags for GitVersion
run: |
git fetch --tags
- name: Fetch master for GitVersion
if: github.ref != 'refs/heads/master'
run: git branch --create-reflog master origin/master

- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: "5.3.x"

- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]

- name: Setup DotNet SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: "3.1.101"
dotnet-version: "3.1.x"

- name: Build
shell: pwsh
run: ./ci-build.ps1 "${{steps.gitversion.outputs.nuGetVersion}}" "${{matrix.options.framework}}"
if: startsWith(github.ref, 'refs/tags/') == false
run: ./ci-build.ps1 "${{matrix.options.framework}}"

- name: Test
shell: pwsh
Expand Down Expand Up @@ -112,31 +96,14 @@ jobs:
git fetch --prune --unshallow
git submodule -q update --init --recursive
- name: Fetch Tags for GitVersion
run: |
git fetch --tags
- name: Fetch master for GitVersion
if: github.ref != 'refs/heads/master'
run: git branch --create-reflog master origin/master

- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: "5.3.x"

- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]

- name: Setup DotNet SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: "3.1.101"
dotnet-version: "3.1.x"

- name: Pack
shell: pwsh
run: ./ci-pack.ps1 "${{steps.gitversion.outputs.nuGetVersion}}"
run: ./ci-pack.ps1

- name: Publish to MyGet
shell: pwsh
Expand Down
6 changes: 6 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
</PropertyGroup>

<!--MinVer Properties for versioning-->
<PropertyGroup>
<MinVerTagPrefix>v</MinVerTagPrefix>
<MinVerVerbosity>normal</MinVerVerbosity>
</PropertyGroup>

<!--
https://apisof.net/
+===================+=======+==========+=====================+=============+=================+====================+==============+=========+
Expand Down
1 change: 1 addition & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<PackageReference Update="StyleCop.Analyzers" PrivateAssets="All" Version="1.1.118" />

<!--Src Dependencies-->
<PackageReference Update="MinVer" PrivateAssets="All" Version="2.3.0" />
<PackageReference Update="System.Buffers" Version="4.5.0" />
<PackageReference Update="System.IO.Compression" Version="4.3.0" />
<PackageReference Update="System.IO.UnmanagedMemoryStream" Version="4.3.0" />
Expand Down
9 changes: 0 additions & 9 deletions GitVersion.yml

This file was deleted.

6 changes: 2 additions & 4 deletions ci-build.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
param(
[Parameter(Mandatory, Position = 0)]
[string]$version,
[Parameter(Mandatory = $true, Position = 1)]
[Parameter(Mandatory = $true, Position = 0)]
[string]$targetFramework
)

Expand All @@ -10,4 +8,4 @@ dotnet clean -c Release
$repositoryUrl = "https://github.com/$env:GITHUB_REPOSITORY"

# Building for a specific framework.
dotnet build -c Release -f $targetFramework /p:packageversion=$version /p:RepositoryUrl=$repositoryUrl
dotnet build -c Release -f $targetFramework /p:RepositoryUrl=$repositoryUrl
7 changes: 1 addition & 6 deletions ci-pack.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
param(
[Parameter(Mandatory, Position = 0)]
[string]$version
)

dotnet clean -c Release

$repositoryUrl = "https://github.com/$env:GITHUB_REPOSITORY"

# Building for packing and publishing.
dotnet pack -c Release --output "$PSScriptRoot/artifacts" /p:packageversion=$version /p:RepositoryUrl=$repositoryUrl
dotnet pack -c Release --output "$PSScriptRoot/artifacts" /p:RepositoryUrl=$repositoryUrl
4 changes: 4 additions & 0 deletions src/ImageSharp/ImageSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
<RootNamespace>SixLabors.ImageSharp</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MinVer" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>
Expand Down

0 comments on commit 6521c1c

Please sign in to comment.