Skip to content

Commit e44b861

Browse files
committed
- update ci pipeline
1 parent 7dede66 commit e44b861

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

.github/workflows/release-ci.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,17 @@ jobs:
6868
- name: Set package version
6969
id: pkg_version
7070
run: |
71-
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
71+
if [[ -z "${{ steps.gitversion.outputs.preReleaseTag }}" ]]; then
7272
echo "version=${{ steps.gitversion.outputs.majorMinorPatch }}" >> $GITHUB_OUTPUT
7373
else
7474
echo "version=${{ steps.gitversion.outputs.semVer }}" >> $GITHUB_OUTPUT
7575
fi
7676
7777
- name: Print version
7878
run: |
79-
echo "SemVer : ${{ steps.gitversion.outputs.semVer }}"
79+
echo "SemVer : ${{ steps.gitversion.outputs.semVer }}"
8080
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}"
81+
echo "PreReleaseTag : ${{ steps.gitversion.outputs.preReleaseTag }}"
8182
echo "Package version: ${{ steps.pkg_version.outputs.version }}"
8283
8384
- name: Setup .NET
@@ -159,18 +160,13 @@ jobs:
159160

160161
- name: Publish to GitHub Packages
161162
run: |
162-
dotnet nuget add source \
163-
--username ${{ github.repository_owner }} \
164-
--password ${{ secrets.GITHUB_TOKEN }} \
165-
--store-password-in-clear-text \
166-
--name github \
167-
"https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
168163
dotnet nuget push "./artifacts/*.nupkg" \
169-
--source github \
164+
--api-key ${{ secrets.GITHUB_TOKEN }} \
165+
--source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
170166
--skip-duplicate
171167
172168
- name: Publish to NuGet.org
173-
if: startsWith(github.ref, 'refs/tags/')
169+
if: steps.gitversion.outputs.preReleaseTag == ''
174170
run: |
175171
dotnet nuget push "./artifacts/*.nupkg" \
176172
--api-key ${{ secrets.NUGET_API_KEY }} \

0 commit comments

Comments
 (0)