Skip to content

Commit

Permalink
Nuget package deterministic builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ninjarobot committed Dec 1, 2022
1 parent 26738bc commit a264017
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.300
dotnet-version: 6.0.403
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/pack-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.300
dotnet-version: 6.0.403
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand All @@ -24,5 +24,7 @@ jobs:
run: dotnet test --no-build --verbosity normal
- name: Pack
run: VERSION=${GITHUB_REF##*/} dotnet pack -o . -c Release
- name: Publish
run: dotnet nuget push FSharp.Text.Docker.*.nupkg -s https://nuget.org -k ${{ secrets.NUGET_API_KEY }}
- name: Publish nuget package
run: dotnet nuget push FSharp.Text.Docker.*.nupkg -s https://nuget.org -k ${{ secrets.NUGET_API_KEY }}
- name: Publish symbols package
run: dotnet nuget push FSharp.Text.Docker.*.snupkg -s https://nuget.org -k ${{ secrets.NUGET_API_KEY }}
18 changes: 13 additions & 5 deletions src/FSharp.Text.Docker.fsproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<Copyright>Copyright (c) 2017-2022 Dave Curylo</Copyright>
<Description>Building Dockerfiles from F#.</Description>
<PackageProjectUrl>https://github.com/ninjarobot/FSharp.Text.Docker</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>docker;fsharp</PackageTags>
<Authors>dcurylo</Authors>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
<ItemGroup>
<Compile Include="Dockerfile.fs" />
Expand All @@ -16,12 +20,16 @@
<None Include="../LICENSE" Pack="true" PackagePath="" />
<None Include="../README.md" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'net6.0' ">
<!-- Set minimum dependency for FSharp.Core instead of using SDK dependency -->
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Update="FSharp.Core" Version="5.0.0" />
<PackageReference Include="System.Text.Json" Version="5.0.1" />
</ItemGroup>
<!-- Enable SourceLink and deterministic builds -->
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.Text.Json" Version="5.0.1" />
</ItemGroup></Project>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
</Project>

0 comments on commit a264017

Please sign in to comment.