Skip to content

Commit 4fbe57f

Browse files
committed
CI/CD Pipelines configuration fixes
1 parent 9283faa commit 4fbe57f

File tree

2 files changed

+16
-23
lines changed

2 files changed

+16
-23
lines changed

.github/workflows/publish-packages.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
name: "Publish Packages"
22

33
on:
4-
push:
5-
branches: [main]
4+
workflow_call:
5+
inputs:
6+
nuget:
7+
description: 'Whether to publish to NuGet.org'
8+
required: false
9+
type: boolean
10+
default: false
611

712
jobs:
813
publish:
@@ -21,4 +26,8 @@ jobs:
2126
run: dotnet pack -c Release --verbosity normal --include-symbols --include-source --version-suffix $GITHUB_RUN_ID --output ./nuget
2227

2328
- name: "Push Packages to GitHub Nuget"
24-
run: dotnet nuget push ./nuget/*.nupkg --source https://nuget.pkg.github.com/deveel --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
29+
run: dotnet nuget push ./nuget/*.nupkg --source https://nuget.pkg.github.com/deveel --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
30+
31+
- name: "Push Packages to NuGet.org"
32+
if: ${{ inputs.nuget == true }}
33+
run: dotnet nuget push ./nuget/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate

.github/workflows/release.yml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,14 @@ jobs:
5858
publish:
5959
name: "Publish Packages"
6060
needs: build
61-
if: github.ref == 'refs/heads/main'
62-
runs-on: ubuntu-latest
63-
64-
steps:
65-
- uses: actions/checkout@v4
66-
67-
- name: "Setup .NET .NET 8.0"
68-
uses: actions/setup-dotnet@v4
69-
with:
70-
dotnet-version: 8.0.x
71-
72-
- name: "Pack"
73-
run: dotnet pack -c Release --verbosity normal --include-symbols --include-source --version-suffix $GITHUB_RUN_ID --output ./nuget
74-
75-
- name: "Push Packages to GitHub Nuget"
76-
run: dotnet nuget push ./nuget/*.nupkg --source https://nuget.pkg.github.com/deveel --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
77-
78-
- name: Publish to NuGet
79-
run: dotnet nuget push ./nuget/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
61+
uses: ./.github/workflows/publish-packages.yml
62+
with:
63+
nuget: true
8064

8165
clean:
8266
name: "Cleaning Old Packages"
8367
needs: publish
84-
uses: ./.github/workflows/publish-packages.yml
68+
uses: ./.github/workflows/clean-packages.yml
8569

8670
create-release:
8771
name: "Create GitHub Release"

0 commit comments

Comments
 (0)