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

Add release pipeline. #14

Merged
merged 3 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: g-research-fsharp-analyzers
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
global-json-file: g-research-fsharp-analyzers/global.json
- name: Build
run: dotnet fsi build.fsx
working-directory: g-research-fsharp-analyzers
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
push:
branches: [ main ]

jobs:
nuget-pack:
runs-on: ubuntu-latest
if: ${{ !github.event.repository.fork && github.ref == 'refs/heads/main' }}
needs: [all-required-checks-complete]
environment: release
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
- name: Build
run: dotnet fsi build.fsx
- name: Pack
run: dotnet pack src/FSharp.Analyzers/FSharp.Analyzers.fsproj --configuration Release --output artifacts
- name: Upload NuGet artifact
uses: actions/upload-artifact@v3
with:
name: nuget-package
path: artifacts/G-Research.FSharp.Analyzers.*.nupkg
nuget-publish:
runs-on: ubuntu-latest
if: ${{ !github.event.repository.fork && github.ref == 'refs/heads/main' }}
needs: [ nuget-pack ]
environment: release
steps:
- name: Download NuGet artifact
uses: actions/download-artifact@v3
with:
name: nuget-package
- name: Publish to NuGet
run: dotnet nuget push "G-Research.FSharp.Analyzers.*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## [Unreleased]
## [0.1.0] - 2023-10-06

### Added
* Initial version
14 changes: 8 additions & 6 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
<!-- Set up version and package release note generation from this changelog. -->
<ChangelogFile>$(MSBuildThisFileDirectory)CHANGELOG.md</ChangelogFile>
<!-- Common packaging properties for all packages in this repo -->
<Authors>Florian Verdonck, David Schaefer</Authors>
<Company>G-Research</Company>
<Authors>David Schaefer, Florian Verdonck</Authors>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Description>
F# analyzers used within G-Research.
</Description>
F# analyzers used within G-Research.
</Description>
<Copyright>Copyright G-Research © $([System.DateTime]::UtcNow.Year)</Copyright>
<PackageTags>F# fsharp analyzers</PackageTags>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Expand All @@ -17,6 +18,7 @@ F# analyzers used within G-Research.
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageProjectUrl>https://g-research.github.io/fsharp-analyzers/</PackageProjectUrl>
<PackageReleaseNotes>https://github.com/G-Research/fsharp-analyzers/blob/main/CHANGELOG.md</PackageReleaseNotes>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<WarningsAsErrors>FS0025</WarningsAsErrors>
Expand All @@ -33,8 +35,8 @@ F# analyzers used within G-Research.
</PropertyGroup>

<ItemGroup Condition="'$(IsPackable)' == 'true'">
<None Include="$(MSBuildThisFileDirectory)README.md" Visible="false" Pack="true" PackagePath="" />
<PackageReference Include="Ionide.KeepAChangelog.Tasks" PrivateAssets="all" />
<PackageReference Include="DotNet.ReproducibleBuilds" PrivateAssets="all" />
<None Include="$(MSBuildThisFileDirectory)README.md" Visible="false" Pack="true" PackagePath=""/>
<PackageReference Include="Ionide.KeepAChangelog.Tasks" PrivateAssets="all"/>
<PackageReference Include="DotNet.ReproducibleBuilds" PrivateAssets="all"/>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<!-- locking the version of F# Core as FCS does this anyway and in practise all will be using the same version -->
<PackageVersion Include="FSharp.Analyzers.SDK" Version="0.14.1" />
<PackageVersion Include="FSharp.Analyzers.SDK" Version="[0.14.1]" />
<PackageVersion Include="FSharp.Analyzers.SDK.Testing" Version="0.14.1" />
<PackageVersion Include="FSharp.Core" Version="[7.0.400]" />
<PackageVersion Include="FSharp.Compiler.Service" Version="[43.7.400]" />
Expand Down
24 changes: 12 additions & 12 deletions src/FSharp.Analyzers/FSharp.Analyzers.fsproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IsPackable>true</IsPackable>
<AssemblyName>G-Research.FSharp.Analyzers</AssemblyName>
<Tailcalls>true</Tailcalls>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IsPackable>true</IsPackable>
<AssemblyName>G-Research.FSharp.Analyzers</AssemblyName>
<Tailcalls>true</Tailcalls>
</PropertyGroup>

<ItemGroup>
<Compile Include="ASTCollecting.fs"/>
Expand All @@ -17,10 +17,10 @@
<Compile Include="StringAnalyzer.fs" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="FSharp.Core"/>
<PackageReference Include="FSharp.Analyzers.SDK" />
<PackageReference Include="FSharp.Compiler.Service"/>
</ItemGroup>
<ItemGroup>
<PackageReference Update="FSharp.Core"/>
<PackageReference Include="FSharp.Analyzers.SDK"/>
<PackageReference Include="FSharp.Compiler.Service"/>
</ItemGroup>

</Project>