Skip to content

Commit 9e837ad

Browse files
authored
Merge pull request #20 from TraGicCode/fixing-dotnet-tool-automated-release
Attempting to fix dotnet tool versioning and auto-release
2 parents c66856c + 6601552 commit 9e837ad

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/dotnet_tool_build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ jobs:
2020
uses: devcontainers/ci@v0.3
2121
with:
2222
runCmd: |
23-
dotnet cake --target Pack-DotNetTool
23+
dotnet cake --target Pack-DotNetTool --version ${{ inputs.version }}
2424
2525
- name: Publish to NuGet (optional)
26-
if: startsWith(github.ref, 'refs/tags/')
2726
run: dotnet nuget push ./nupkg/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Release
33
on:
44
workflow_dispatch: {}
55

6+
permissions:
7+
contents: write
8+
9+
610
jobs:
711
get-version:
812
runs-on: ubuntu-latest

build.cake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var target = Argument("target", "Build");
22
var configuration = Argument("configuration", "Release");
3+
var version = Argument("package-version", "0.1.0"); // default version if none is passed
34

45
var srcDirectory = "./src";
56
var consoleCsproj = $"{srcDirectory}/BuslyCLI.Console/BuslyCLI.Console.csproj";
@@ -74,6 +75,10 @@ Task("Pack-DotNetTool")
7475
{
7576
Configuration = configuration,
7677
OutputDirectory = "./artifacts/nupkgs",
78+
MSBuildSettings = new DotNetMSBuildSettings
79+
{
80+
Version = version,
81+
},
7782
});
7883
});
7984

0 commit comments

Comments
 (0)