29
29
echo "NUGET_API_KEY_DEFINED=true" >> $env:GITHUB_ENV
30
30
}
31
31
32
+ if ('${{ secrets.NPM_API_KEY }}') {
33
+ Write-Host "NPM_API_KEY secret detected. NPM packages will be pushed."
34
+ echo "NPM_API_KEY_DEFINED=true" >> $env:GITHUB_ENV
35
+ }
36
+
32
37
- name : 🔎 Search for build of ${{ github.ref }}
33
38
shell : pwsh
34
39
id : findrunid
77
82
- name : 🔏 Code sign
78
83
shell : pwsh
79
84
run : >
85
+ rm global.json # avoid a need to install a particular SDK version
86
+
80
87
dotnet tool install --tool-path obj SignClient
81
88
82
89
obj/SignClient sign
@@ -91,11 +98,11 @@ jobs:
91
98
92
99
- name : 💽 Upload artifacts to release
93
100
shell : pwsh
94
- if : ${{ github.event.release.assets_url }} != ''
101
+ if : ${{ github.event_name == 'release' && github. event.release.assets_url != '' }}
95
102
env :
96
103
GH_TOKEN : ${{ github.token }}
97
104
run : |
98
- Get-ChildItem '${{ runner.temp }}/deployables' |% {
105
+ Get-ChildItem '${{ runner.temp }}/deployables' -File -Recurse |% {
99
106
Write-Host "Uploading $($_.Name) to release..."
100
107
gh release -R ${{ github.repository }} upload "${{ github.ref_name }}" $_.FullName
101
108
}
@@ -105,10 +112,10 @@ jobs:
105
112
if : ${{ env.NUGET_API_KEY_DEFINED == 'true' }}
106
113
107
114
- name : 🚀 Push NPM packages
115
+ shell : pwsh
108
116
run : |
109
- npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_API_KEY }}
117
+ npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_API_KEY }}
110
118
Get-ChildItem '${{ runner.temp }}/deployables/*.tgz' |% {
111
119
npm publish $_ --registry=https://registry.npmjs.org/
112
120
}
113
- env :
114
- NPM_AUTH_TOKEN : ${{ secrets.NPM_API_KEY }}
121
+ if : ${{ env.NPM_API_KEY_DEFINED == 'true' }}
0 commit comments