Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use MinVer #3562

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/build-artifacts-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MinVer need tags to work. It's a known issue with actions/checkout - this action has no explicit option to fetch tags. fetch-depth: 0 effectivelty fetches all tags. Yep, it fetches all commits as well 😞 .

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -51,10 +53,10 @@ jobs:
run: dotnet restore
- name: Build solution [Release]
working-directory: src
run: dotnet build --no-restore -c Release -p:VersionSuffix=$GITHUB_RUN_NUMBER
run: dotnet build --no-restore -c Release
- name: Pack solution [Release]
working-directory: src
run: dotnet pack --no-restore --no-build -c Release -p:VersionSuffix=$GITHUB_RUN_NUMBER -o out
run: dotnet pack --no-restore --no-build -c Release -o out
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
Expand Down
19 changes: 4 additions & 15 deletions .github/workflows/publish-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check github.ref starts with 'refs/tags/'
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: |
echo Error! github.ref does not start with 'refs/tags'
echo github.ref: ${{ github.ref }}
exit 1
- name: Set version number environment variable
env:
github_ref: ${{ github.ref }}
run: |
version="${github_ref:10}"
echo version=$version
echo "version=$version" >> $GITHUB_ENV
with:
fetch-depth: 0
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -58,10 +47,10 @@ jobs:
run: dotnet restore
- name: Build solution [Release]
working-directory: src
run: dotnet build --no-restore -c Release -p:Version=$version
run: dotnet build --no-restore -c Release
- name: Pack solution [Release]
working-directory: src
run: dotnet pack --no-restore --no-build -c Release -p:Version=$version -o out
run: dotnet pack --no-restore --no-build -c Release -o out
- name: Upload Nuget packages as workflow artifacts
uses: actions/upload-artifact@v3
with:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ jobs:
source-url: https://nuget.pkg.github.com/graphql-dotnet/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Disable MSVS Nuget Source # temporary step to investigate https://github.com/graphql-dotnet/graphql-dotnet/issues/2422
if: ${{ startsWith(matrix.os, 'windows') }}
run: dotnet nuget disable source 'Microsoft Visual Studio Offline Packages'
- name: Install dependencies
working-directory: src
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<VersionPrefix>7.3.0-preview</VersionPrefix>
<MinVerDefaultPreReleaseIdentifiers>preview</MinVerDefaultPreReleaseIdentifiers>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<NextVersion>8.0.0</NextVersion>
<LangVersion>latest</LangVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
1 change: 1 addition & 0 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<None Include="..\..\assets\logo.64x64.png" Pack="true" PackagePath="\" Visible="false" />
<None Include="..\..\README.md" Pack="true" PackagePath="\" Visible="false" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="4.3.0" PrivateAssets="All" />
<InternalsVisibleTo Condition="'$(SignAssembly)' == 'true'" Include="$(MSBuildProjectName).Tests, $(_FriendAssembliesPublicKey)"/>
<InternalsVisibleTo Condition="'$(SignAssembly)' != 'true'" Include="$(MSBuildProjectName).Tests"/>
</ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion src/GraphQL.Tests/AssemblyExtensionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ private void GetClrTypeMappings_Test(Type[] typeList, IEnumerable<(Type ClrType,
[Fact]
public void CanGetNuGetVersion()
{
typeof(IGraphQLBuilder).Assembly.GetNuGetVersion().ShouldNotBeNull().ShouldEndWith("-preview");
var version = typeof(IGraphQLBuilder).Assembly.GetNuGetVersion().ShouldNotBeNull();
var index = version.LastIndexOf("-preview.");
if (index != -1)
int.Parse(version.Substring(index + 9)).ShouldBeGreaterThan(0);
}

public class MockableAssembly : Assembly
Expand Down