Skip to content

Commit

Permalink
task: New Powershell Publish (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
no1melman authored Dec 22, 2021
1 parent 12ebf45 commit 92af705
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ jobs:
publish:
docker:
- image: mcr.microsoft.com/dotnet/sdk:latest
entrypoint: pwsh # start up powershell
resource_class: small
steps:
- checkout
- run:
working_directory: ~/project
name: Publish
command: |
./publish.ps1 -apiKey ${NUGET_KEY}
pwsh ./publish.ps1 -ApiKey ${NUGET_KEY}
# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
Expand Down
1 change: 1 addition & 0 deletions Melman.EventStore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "misc", "misc", "{9FAA05FB-1
ProjectSection(SolutionItems) = preProject
publish.ps1 = publish.ps1
README.md = README.md
.circleci\config.yml = .circleci\config.yml
EndProjectSection
EndProject
Global
Expand Down
6 changes: 3 additions & 3 deletions publish.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
param (
[Parameter(Mandatory=$true)]
[String] $apiKey
[String] $ApiKey
)


Expand All @@ -27,7 +27,7 @@ function PublishProject {
Write-Host "No remote infomration, could be first time package - got $code"

dotnet pack $projectPath -c Release -o ./packs/$packageId
dotnet nuget push "./packs/$packageId/$packageId.$version.nupkg" --source https://api.nuget.org/v3/index.json --api-key $apiKey;
dotnet nuget push "./packs/$packageId/$packageId.$version.nupkg" --source https://api.nuget.org/v3/index.json --api-key $ApiKey;

return;
}
Expand All @@ -43,7 +43,7 @@ function PublishProject {
Write-Host "Creating and publishing $packageId.$version"

dotnet pack $projectPath -c Release -o ./packs/$packageId
dotnet nuget push "./packs/$packageId/$packageId.$version.nupkg" --source https://api.nuget.org/v3/index.json --api-key $apiKey;
dotnet nuget push "./packs/$packageId/$packageId.$version.nupkg" --source https://api.nuget.org/v3/index.json --api-key $ApiKey;
}

Get-ChildItem -Path ./src/**/*.fsproj -Recurse
Expand Down

0 comments on commit 92af705

Please sign in to comment.