Skip to content
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
18 changes: 18 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": 1,
"isRoot": true,
"tools": {
"microsoft.sbom.dotnettool": {
"version": "4.1.4",
"commands": [
"sbom-tool"
]
},
"demaconsulting.spdxtool": {
"version": "2.5.0",
"commands": [
"spdx-tool"
]
}
}
}
74 changes: 74 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
on:
workflow_call:
inputs:
wrapper:
required: true
type: string
vswhere:
required: true
type: string
version:
required: true
type: string

jobs:
build:
runs-on: ubuntu-24.04
steps:

- uses: actions/checkout@v6

- name: Setup dotnet
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
10.x

- name: Restore Tools
run: >
dotnet tool restore

- name: Insert Wrapper
shell: bash
run: |
wget https://github.com/demaconsulting/DotnetToolWrapper/releases/download/${{ inputs.wrapper }}/manifest.spdx.json
wget https://github.com/demaconsulting/DotnetToolWrapper/releases/download/${{ inputs.wrapper }}/DotnetToolWrapper.zip
unzip -o DotnetToolWrapper.zip -d DotnetToolWrapper
cp DotnetToolWrapper/net8.0/*.* pack/tools/net8.0/any
cp DotnetToolWrapper/net9.0/*.* pack/tools/net9.0/any
cp DotnetToolWrapper/net10.0/*.* pack/tools/net10.0/any

- name: Insert VSWhere
run: |
mkdir pack/win-x86
wget https://github.com/microsoft/vswhere/releases/download/${{ inputs.vswhere }}/vswhere.exe -O pack/win-x86/vswhere.exe

- name: Generate SBOM
run: >
dotnet sbom-tool generate
-b pack
-pn DemaConsulting.VSWhereTool
-pv ${{ inputs.version }}
-ps DemaConsulting
-nsb https://DemaConsulting.com/VSWhereTool
-li true
-pm true

- name: Enhance SBOM
shell: bash
run: |
dotnet spdx-tool run-workflow spdx-workflow.yaml vswhere-version=${{ inputs.vswhere }}

- name: Create Dotnet Tool
run: |
cd pack
dotnet pack DemaConsulting.VSWhereTool.csproj -p:Version=${{ inputs.version }} -o .

- name: Upload Artifacts
uses: actions/upload-artifact@v5
with:
name: build-artifacts
path: |
pack/*.nupkg
pack/_manifest/spdx_2.2/*.*

36 changes: 6 additions & 30 deletions .github/workflows/build_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,9 @@ on: [push]

jobs:
build:

runs-on: ubuntu-22.04

steps:

- uses: actions/checkout@v4

- uses: nuget/setup-nuget@v2
with:
nuget-version: latest

- name: Insert Wrapper
run: |
wget https://github.com/demaconsulting/DotnetToolWrapper/releases/download/1.0.0/DotnetToolWrapper.zip
unzip -o DotnetToolWrapper.zip -d pack/tools/net6.0/any

- name: Insert VSWhere
run: |
wget https://github.com/microsoft/vswhere/releases/download/3.1.7/vswhere.exe -O pack/tools/net6.0/any/vswhere.exe

- name: Create Dotnet Tool
run: |
cd pack
nuget pack

- name: Upload asset
uses: actions/upload-artifact@v4
with:
name: VSWhereTool
path: pack/*.nupkg
name: Build Artifacts
uses: ./.github/workflows/build.yaml
with:
wrapper: "1.2.0"
vswhere: "3.1.7"
version: 0.0.0-run.${{ github.run_number }}
56 changes: 23 additions & 33 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
wrapper:
description: 'Wrapper version (1.0.0)'
description: 'Wrapper version (1.2.0)'
required: true
vswhere:
description: 'VSWhere version (3.1.7)'
Expand All @@ -23,61 +23,51 @@ on:
- publish

jobs:
build:
name: Build Artifacts
uses: ./.github/workflows/build.yaml
with:
wrapper: ${{ inputs.wrapper }}
weasyprint: ${{ inputs.weasyprint }}
version: ${{ inputs.version }}

release:

permissions:
contents: write
packages: write

runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

needs: build

steps:

- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Setup dotnet 8
uses: actions/setup-dotnet@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.x

- uses: nuget/setup-nuget@v2
with:
nuget-version: latest

- name: Insert Wrapper
run: |
wget https://github.com/demaconsulting/DotnetToolWrapper/releases/download/${{ github.event.inputs.wrapper }}/DotnetToolWrapper.zip
unzip -o DotnetToolWrapper.zip -d pack/tools/net6.0/any

- name: Insert VSWhere
run: |
wget https://github.com/microsoft/vswhere/releases/download/${{ github.event.inputs.vswhere }}/vswhere.exe -O pack/tools/net6.0/any/vswhere.exe

- name: Create Dotnet Tool
run: |
cd pack
nuget pack -Version ${{ github.event.inputs.version }}
10.x

- name: Upload Artifacts
uses: actions/upload-artifact@v4
- name: Download Artifacts
uses: actions/download-artifact@v5
with:
name: artifacts-release
path: |
pack/*.nupkg
name: build-artifacts
path: build-artifacts

- name: Create release
if: ${{ inputs.publish == 'release' || inputs.publish == 'publish' }}
uses: ncipollo/release-action@v1
with:
artifacts: pack/*.nupkg
artifacts: "build-artifacts/*.nupkg,build-artifacts/_manifest/spdx_2.2/*.*"
generateReleaseNotes: true
tag: ${{ github.event.inputs.version }}
tag: ${{ inputs.version }}

- name: Publish to Nuget
if: ${{ inputs.publish == 'publish' }}
run: >
dotnet nuget push
pack/*.nupkg
build-artifacts/*.nupkg
--source "https://api.nuget.org/v3/index.json"
--api-key "${{ secrets.DEMACONSULTINGNUGETKEY }}"
7 changes: 7 additions & 0 deletions pack/DemaConsulting.VSWhereTool.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<NuspecFile>DemaConsulting.VSWhereTool.nuspec</NuspecFile>
<NuspecProperties>version=$(Version)</NuspecProperties>
</PropertyGroup>
</Project>
3 changes: 2 additions & 1 deletion pack/DemaConsulting.VSWhereTool.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>DemaConsulting.VSWhereTool</id>
<version>0.0.0</version>
<version>$version$</version>
<title>VSWhere Dotnet Tool</title>
<authors>Dema Consulting</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
Expand All @@ -22,5 +22,6 @@
<file src="../README.md" target="docs/README.md" />
<file src="../Icon.png" target="docs/Icon.png" />
<file src="tools/**/*" target="tools" />
<file src="win-x86/**/*" target="win-x86" />
</files>
</package>
8 changes: 8 additions & 0 deletions pack/tools/net10.0/any/DotnetToolWrapper.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"win-x64": {
"program": "../../../win-x86/vswhere.exe"
},
"win-x86": {
"program": "../../../win-x86/vswhere.exe"
}
}
5 changes: 0 additions & 5 deletions pack/tools/net6.0/any/DotnetToolWrapper.json

This file was deleted.

6 changes: 6 additions & 0 deletions pack/tools/net8.0/any/DotnetToolSettings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<DotNetCliTool Version="1">
<Commands>
<Command Name="vswhere" EntryPoint="DemaConsulting.DotnetToolWrapper.dll" Runner="dotnet" />
</Commands>
</DotNetCliTool>
8 changes: 8 additions & 0 deletions pack/tools/net8.0/any/DotnetToolWrapper.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"win-x64": {
"program": "../../../win-x86/vswhere.exe"
},
"win-x86": {
"program": "../../../win-x86/vswhere.exe"
}
}
6 changes: 6 additions & 0 deletions pack/tools/net9.0/any/DotnetToolSettings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<DotNetCliTool Version="1">
<Commands>
<Command Name="vswhere" EntryPoint="DemaConsulting.DotnetToolWrapper.dll" Runner="dotnet" />
</Commands>
</DotNetCliTool>
8 changes: 8 additions & 0 deletions pack/tools/net9.0/any/DotnetToolWrapper.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"win-x64": {
"program": "../../../win-x86/vswhere.exe"
},
"win-x86": {
"program": "../../../win-x86/vswhere.exe"
}
}
Loading
Loading