diff --git a/.github/workflows/dotnet_tool_build.yml b/.github/workflows/dotnet_tool_build.yml index 864db78..652a7a8 100644 --- a/.github/workflows/dotnet_tool_build.yml +++ b/.github/workflows/dotnet_tool_build.yml @@ -20,8 +20,7 @@ jobs: uses: devcontainers/ci@v0.3 with: runCmd: | - dotnet cake --target Pack-DotNetTool + dotnet cake --target Pack-DotNetTool --version ${{ inputs.version }} - name: Publish to NuGet (optional) - if: startsWith(github.ref, 'refs/tags/') run: dotnet nuget push ./nupkg/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1851435..8081dd5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,10 @@ name: Release on: workflow_dispatch: {} +permissions: + contents: write + + jobs: get-version: runs-on: ubuntu-latest diff --git a/build.cake b/build.cake index 2bcbd0b..e9eb0f7 100644 --- a/build.cake +++ b/build.cake @@ -1,5 +1,6 @@ var target = Argument("target", "Build"); var configuration = Argument("configuration", "Release"); +var version = Argument("package-version", "0.1.0"); // default version if none is passed var srcDirectory = "./src"; var consoleCsproj = $"{srcDirectory}/BuslyCLI.Console/BuslyCLI.Console.csproj"; @@ -74,6 +75,10 @@ Task("Pack-DotNetTool") { Configuration = configuration, OutputDirectory = "./artifacts/nupkgs", + MSBuildSettings = new DotNetMSBuildSettings + { + Version = version, + }, }); });