Skip to content

Commit

Permalink
Update the build SDK to version 3.1.0
Browse files Browse the repository at this point in the history
- update GitHub Actions
- drop AppVeyor builds
  - instead, use GitHub Actions for CI
- enable Dependabot for GitHub Actions and configure labels for it
- set `AssemblyIsComVisible` to `false` in the project file
  - allows dropping the `AssemblyInfo.cs` file
- add "public API" reference files
- align copyright years between license file and project
- target `net6.0` and `net8.0` only
  - bump version to 4.0.0-pre
  • Loading branch information
Zastai committed Dec 13, 2023
1 parent b26abae commit 6f76ca5
Show file tree
Hide file tree
Showing 15 changed files with 1,063 additions and 27 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,13 @@ updates:
directory: "/"
schedule:
interval: "daily"
labels:
- "dependencies"
- "nuget"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "dependencies"
- "gh-actions"
8 changes: 8 additions & 0 deletions .github/github-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@
color: '008672'
description: "Changes related to unit tests"

# Additional Labels Used by Dependabot
- name: gh-actions
color: '1d0128'
description: "Version updates for GitHub actions"
- name: nuget
color: '1d0128'
description: "Version updates for NuGet packages"

# Additional Labels for Release Drafter Version Resolution
- name: bump-major-version
color: 'cf996b'
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build

on:
push:
branches:
- 'main'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches:
- 'main'

jobs:
build:
runs-on: ubuntu-latest
env:
dotnet-version: 8.0.x
strategy:
matrix:
configuration: ['Debug', 'Release']

steps:
- name: Check out the project
uses: actions/checkout@v4
- name: Set up .NET ${{env.dotnet-version}}
uses: actions/setup-dotnet@v4
id: setup
with:
dotnet-version: ${{env.dotnet-version}}
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Create global.json to force use of .NET SDK ${{steps.setup.outputs.dotnet-version}}
run: echo '{"sdk":{"version":"${{steps.setup.outputs.dotnet-version}}"}}' > ./global.json
- name: Run build script (${{matrix.configuration}})
run: pwsh ./build-package.ps1 -ContinuousIntegration -WithBinLog -Configuration ${{matrix.configuration}}
- name: "Artifact: MSBuild Logs"
uses: actions/upload-artifact@v3
if: failure()
with:
name: MSBuild Logs (${{matrix.configuration}})
path: msbuild.*.binlog
- name: "Artifact: NuGet Packages"
uses: actions/upload-artifact@v3
with:
name: NuGet Packages (${{matrix.configuration}})
path: "output/package/${{matrix.configuration}}/*.*nupkg"
- name: Publish (NuGet - GitHub Packages)
if: matrix.configuration == 'Release' && startsWith(github.ref, 'refs/tags/v')
run: "dotnet nuget push output/package/${{matrix.configuration}}/*.nupkg -s https://nuget.pkg.github.com/zastai/index.json -k ${{secrets.GITHUB_TOKEN}}"
- name: Publish (NuGet - nuget.org)
if: matrix.configuration == 'Release' && startsWith(github.ref, 'refs/tags/v')
run: "dotnet nuget push output/package/${{matrix.configuration}}/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}}"
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5.15.0
- uses: release-drafter/release-drafter@v5.25.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/update-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Labeler
if: success()
uses: crazy-max/ghaction-github-labeler@v3
uses: crazy-max/ghaction-github-labeler@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
yaml-file: .github/github-labels.yml
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright (c) 2021 Tim Van Holder
Copyright (c) 2016-2023 Tim Van Holder

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 2 additions & 3 deletions MetaBrainz.MusicBrainz.DiscId.sln
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31912.275
VisualStudioVersion = 17.8.34330.188
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Support Files", "Support Files", "{F997B31A-CF25-4C63-BEB5-172F7E13D9B3}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
appveyor.yml = appveyor.yml
build-package.ps1 = build-package.ps1
Directory.Packages.props = Directory.Packages.props
global.json = global.json
LICENSE.md = LICENSE.md
package-icon.png = package-icon.png
README.md = README.md
Expand All @@ -26,6 +24,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub", "GitHub", "{935533
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Actions", "Actions", "{9FD24444-85F6-4C28-AFA0-3F00E9F307F0}"
ProjectSection(SolutionItems) = preProject
.github\workflows\build.yml = .github\workflows\build.yml
.github\workflows\release-drafter.yml = .github\workflows\release-drafter.yml
.github\workflows\update-labels.yml = .github\workflows\update-labels.yml
EndProjectSection
Expand Down
14 changes: 11 additions & 3 deletions MetaBrainz.MusicBrainz.DiscId/MetaBrainz.MusicBrainz.DiscId.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="MetaBrainz.Build.Sdk">
<Project>

<Sdk Name="MetaBrainz.Build.Sdk" Version="3.1.0" />

<PropertyGroup>
<Authors>Zastai</Authors>
<Title>MusicBrainz DiscID Library</Title>
<Description>This package provides classes for accessing information about a CD (its MusicBrainz Disc ID, EAN/ISRC values, CD-TEXT info, ...).</Description>
<PackageCopyrightYears>2016-2021</PackageCopyrightYears>
<PackageCopyrightOwners>Tim Van Holder</PackageCopyrightOwners>
<PackageCopyrightYears>2016-2023</PackageCopyrightYears>
<PackageRepositoryName>MetaBrainz.MusicBrainz.DiscId</PackageRepositoryName>
<PackageTags>MusicBrainz discid audio cd cd-text isrc upc ean libdiscid</PackageTags>
<Version>3.0.1-pre</Version>
<Version>4.0.0-pre</Version>
</PropertyGroup>

<PropertyGroup>
<AssemblyIsComVisible>false</AssemblyIsComVisible>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 0 additions & 3 deletions MetaBrainz.MusicBrainz.DiscId/Properties/AssemblyInfo.cs

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ easy way to get Mono to work on it.
Support for OSX is similarly unlikely, because I have no access to a
system.

[CI-S]: https://img.shields.io/appveyor/build/zastai/metabrainz-musicbrainz-discid
[CI-L]: https://ci.appveyor.com/project/Zastai/metabrainz-musicbrainz-discid
[CI-S]: https://github.com/Zastai/MetaBrainz.MusicBrainz.DiscId/actions/workflows/build.yml/badge.svg
[CI-L]: https://github.com/Zastai/MetaBrainz.MusicBrainz.DiscId/actions/workflows/build.yml

[NuGet-S]: https://img.shields.io/nuget/v/MetaBrainz.MusicBrainz.DiscId
[NuGet-L]: https://www.nuget.org/packages/MetaBrainz.MusicBrainz.DiscId
6 changes: 0 additions & 6 deletions appveyor.yml

This file was deleted.

11 changes: 10 additions & 1 deletion build-package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[CmdletBinding()]
param (
[string] $Configuration = 'Release',
[switch] $ContinuousIntegration = $false,
[switch] $WithBinLog = $false
)

Expand Down Expand Up @@ -41,7 +42,15 @@ if ($LASTEXITCODE -ne 0) {
}

Write-Host "Building the solution (Configuration: $Configuration)..."
dotnet build $opts --no-restore "-c:$Configuration" '-p:ContinuousIntegrationBuild=true' '-p:Deterministic=true'
$props = @()
if ($ContinuousIntegration) {
$props += '-p:ContinuousIntegrationBuild=true'
$props += '-p:Deterministic=true'
}
if ($Configuration -eq 'Debug') {
$props += '-p:DebugMessageImportance=high'
}
dotnet build $opts --no-restore "-c:$Configuration" $props
Complete-BuildStep 'build'
if ($LASTEXITCODE -ne 0) {
Write-Error "SOLUTION BUILD FAILED"
Expand Down
5 changes: 0 additions & 5 deletions global.json

This file was deleted.

Loading

0 comments on commit 6f76ca5

Please sign in to comment.