Skip to content

Commit 99f97a6

Browse files
Refresh infrastructure. (#1)
* Use .NET 8 SDK. * Update GitHub Actions. * Add Release workflow. * Remove unnecessary Jetbrains.Annotations dependency. * Use `DotNet.ReproducibleBuilds`. * Fix CI running twice.
1 parent 08cb89a commit 99f97a6

File tree

9 files changed

+63
-19
lines changed

9 files changed

+63
-19
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: Test
2-
on: [push, pull_request]
2+
on:
3+
push:
4+
branches:
5+
- mainstream
6+
pull_request:
7+
branches:
8+
- mainstream
39
jobs:
410
test:
511
# name: Run tests
@@ -16,17 +22,17 @@ jobs:
1622

1723
steps:
1824
- name: Check out the repository
19-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2026
- name: Setup .NET
21-
uses: actions/setup-dotnet@v2.1.0
27+
uses: actions/setup-dotnet@v4
2228
- name: Add msbuild to PATH
23-
uses: microsoft/setup-msbuild@v1.1
29+
uses: microsoft/setup-msbuild@v2
2430
if: ${{ contains(matrix.os, 'windows') }}
2531
- name: Run the test script
2632
shell: pwsh
2733
run: ./test.ps1
2834
- name: Upload the failed test logs
29-
uses: actions/upload-artifact@v3
35+
uses: actions/upload-artifact@v4
3036
with:
3137
name: testlogs-${{ matrix.os }}
3238
path: ./test-logs/

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ jobs:
2121
security-events: write
2222
steps:
2323
- name: Checkout repository
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2525
- name: Initialize CodeQL
26-
uses: github/codeql-action/init@v2
26+
uses: github/codeql-action/init@v3
2727
with:
2828
languages: csharp
2929
- name: Build Sigourney
3030
run: dotnet build src/Sigourney/Sigourney.csproj
3131
- name: Perform CodeQL Analysis
32-
uses: github/codeql-action/analyze@v2
32+
uses: github/codeql-action/analyze@v3

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- mainstream
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
11+
jobs:
12+
pack:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check out the repository
16+
uses: actions/checkout@v4
17+
- name: Setup .NET
18+
uses: actions/setup-dotnet@v4
19+
- name: Add nightly pack options
20+
if: github.event_name != 'release'
21+
id: pack-options-nightly
22+
run: echo "value=--version-suffix ${{ github.event_name == 'push' && 'nightly' || github.ref_name }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
23+
- name: Pack
24+
run: dotnet pack -c Release -o ./pack ${{ steps.pack-options-nightly.outputs.value }}
25+
- name: Upload package artifacts
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: nuget-packages
29+
path: ./pack
30+
release:
31+
needs: pack
32+
environment: ${{ github.event_name == 'release' && 'release' || 'nightly' }}
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Check out the repository
36+
uses: actions/checkout@v4
37+
- name: Setup .NET
38+
uses: actions/setup-dotnet@v4
39+
- name: Download package artifacts
40+
uses: actions/download-artifact@v4
41+
with:
42+
name: nuget-packages
43+
path: ./pack
44+
- name: Publish
45+
run: dotnet nuget push ./pack/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source ${{ vars.NUGET_FEED }}

global.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"sdk": {
3-
"version": "6.0.400"
3+
"version": "8.0.100",
4+
"rollForward": "major"
45
}
56
}

src/Sigourney/AssemblyReference.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using System.Collections.Generic;
99
using System.Linq;
1010
using System.Runtime.CompilerServices;
11-
using JetBrains.Annotations;
1211
using Mono.Cecil;
1312
using Serilog;
1413

@@ -20,7 +19,6 @@ namespace Sigourney
2019
/// </summary>
2120
/// <remarks>Two <see cref="AssemblyReference"/> objects are
2221
/// considered as equal if they point to the same file name.</remarks>
23-
[PublicAPI]
2422
public sealed class AssemblyReference : IEquatable<AssemblyReference>, IComparable<AssemblyReference>, IComparable
2523
{
2624
/// <summary>

src/Sigourney/MSBuildWeaver.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Threading;
4-
using JetBrains.Annotations;
54
using Microsoft.Build.Framework;
65
using Microsoft.Build.Utilities;
76
using Mono.Cecil;
@@ -14,7 +13,6 @@ namespace Sigourney
1413
/// <summary>
1514
/// An abstract MSBuild task that weaves assemblies with Sigourney.
1615
/// </summary>
17-
[PublicAPI]
1816
public abstract class MSBuildWeaver : Task
1917
{
2018
private static readonly List<AssemblyReference> _emptyReferenceList = new List<AssemblyReference>();

src/Sigourney/Sigourney.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<Import Project="../nuget.props" />
33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
@@ -19,7 +19,6 @@ Version 4.0.1 fixed a bug where Sigourney did not run on F#.</PackageReleaseNote
1919
<Nullable>enable</Nullable>
2020
</PropertyGroup>
2121
<ItemGroup>
22-
<PackageReference Include="JetBrains.Annotations" Version="2021.1.0" PrivateAssets="all" />
2322
<PackageReference Include="Mono.Cecil" Version="0.11.4" />
2423
<PackageReference Include="Serilog" Version="2.10.0" />
2524
<PackageReference Include="Serilog.Sinks.MSBuild" Version="1.4.0" />

src/Sigourney/Weaver.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System.IO;
88
using System.Linq;
99
using System.Reflection;
10-
using JetBrains.Annotations;
1110
using Mono.Cecil;
1211
using Serilog;
1312

@@ -18,7 +17,6 @@ namespace Sigourney
1817
/// </summary>
1918
/// <remarks>The type's fully qualified name does not imply
2019
/// an endorsement or support of any kind from anyone.</remarks>
21-
[PublicAPI]
2220
public static class Weaver
2321
{
2422
private static string GetAssemblyVersion(Assembly asm)

src/nuget.props

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
<PackageLicenseExpression>MIT</PackageLicenseExpression>
77
<PackageProjectUrl>https://github.com/teo-tsirpanis/Sigourney</PackageProjectUrl>
88
<PackageTags>ILWeaving;Sigourney</PackageTags>
9-
<PublishRepositoryUrl>true</PublishRepositoryUrl>
109
</PropertyGroup>
1110
<ItemGroup>
12-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="all" />
11+
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.2.25" PrivateAssets="all" />
1312
</ItemGroup>
1413
</Project>

0 commit comments

Comments
 (0)