Skip to content

Commit 13004ef

Browse files
Update CD.yml Revert code to normal opperation
1 parent 5e699f9 commit 13004ef

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

.github/workflows/CD.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: CD
22

33
on:
4-
workflow_dispatch:
54
# workflow_dispatch:
65
release:
76
types: [published]
@@ -42,3 +41,36 @@ jobs:
4241
- name: Setup NuGet
4342
uses: NuGet/setup-nuget@v1.0.5
4443

44+
- name: Restore NuGet packages.sln
45+
run: nuget restore ./src/${{ env.FILE_NAME}}.sln
46+
47+
- name: Build Solution
48+
run: msbuild ./src/${{ env.FILE_NAME}}.sln /p:Configuration=Release
49+
50+
- name: Prepare .nuspec
51+
run: |
52+
$nuspecPath = "src/${{ env.FILE_NAME }}.nuspec.in"
53+
$nuspec = Get-Content $nuspecPath
54+
$nuspec = $nuspec -replace '\$\{\{ env.FILE_NAME \}\}', '${{ env.FILE_NAME }}'
55+
$nuspec = $nuspec -replace '\$\{\{ env.TITLE \}\}', '${{ env.TITLE }}'
56+
$nuspec = $nuspec -replace '\$\{\{ env.DESCRIPTION \}\}', '${{ env.DESCRIPTION }}'
57+
$nuspec = $nuspec -replace '\$\{\{ env.TAGS \}\}', '${{ env.TAGS }}'
58+
$nuspec = $nuspec -replace '\$\{\{ env.GITHUB_URL \}\}', '${{ env.GITHUB_URL }}'
59+
$nuspec = $nuspec -replace '\$\{\{ env.REPOSITORY_URL \}\}', '${{ env.REPOSITORY_URL }}'
60+
Set-Content ThunderDesign.Net-PCL.nuspec $nuspec
61+
shell: pwsh
62+
63+
- name: Create NuGet Package
64+
# run: nuget pack ThunderDesign.Net-PCL.nuspec -Version 1.1.4 -OutputDirectory ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
65+
run: nuget pack ThunderDesign.Net-PCL.nuspec -Version ${{ github.event.release.tag_name }} -OutputDirectory ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
66+
67+
- name: Archive NuGet Package
68+
uses: actions/upload-artifact@v4
69+
with:
70+
# name: Package_${{ env.FILE_NAME}}.1.1.4
71+
# path: ${{ env.PACKAGE_OUTPUT_DIRECTORY}}\${{ env.FILE_NAME}}.1.1.4.nupkg
72+
name: Package_${{ env.FILE_NAME}}.${{ github.event.release.tag_name }}
73+
path: ${{ env.PACKAGE_OUTPUT_DIRECTORY}}\${{ env.FILE_NAME}}.${{ github.event.release.tag_name }}.nupkg
74+
75+
- name: Publish NuGet Package
76+
run: nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY}}\${{ env.FILE_NAME}}.${{ github.event.release.tag_name }}.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_API_KEY }}

0 commit comments

Comments
 (0)