Skip to content

Commit 299fc3a

Browse files
Copilotdadhi
andauthored
fix: fix publish workflow to use nuget pack and push to GitHub Packages
Agent-Logs-Url: https://github.com/dadhi/FastExpressionCompiler/sessions/bf6615b5-5608-4aad-8daa-dd48bfa40acb Co-authored-by: dadhi <39516+dadhi@users.noreply.github.com>
1 parent 1df74d2 commit 299fc3a

1 file changed

Lines changed: 18 additions & 12 deletions

File tree

.github/workflows/publish.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,35 @@ jobs:
1919
with:
2020
global-json-file: global.json
2121

22+
- name: Install NuGet CLI
23+
run: sudo apt-get install -y nuget
24+
2225
- name: Build
2326
run: dotnet build -c:Release
2427

2528
- name: Make Internal
2629
shell: pwsh
2730
run: ./BuildScripts/MakeInternal.ps1
2831

29-
- name: Pack with dotnet
32+
- name: Pack
3033
run: |
31-
arrTag=(${GITHUB_REF//\// })
32-
VERSION="${arrTag[2]}"
33-
VERSION="${VERSION//v}"
34-
echo "$VERSION"
35-
36-
dotnet pack --no-build --output artifacts -p:Version=$VERSION -p:ContinuousIntegrationBuild=True ./nuspecs/FastExpressionCompiler.src.nuspec
37-
dotnet pack --no-build --output artifacts -p:Version=$VERSION -p:ContinuousIntegrationBuild=True ./nuspecs/FastExpressionCompiler.LightExpression.src.nuspec
38-
dotnet pack --no-build --output artifacts -p:Version=$VERSION -p:ContinuousIntegrationBuild=True ./nuspecs/FastExpressionCompiler.Internal.src.nuspec
39-
dotnet pack --no-build --output artifacts -p:Version=$VERSION -p:ContinuousIntegrationBuild=True ./nuspecs/FastExpressionCompiler.LightExpression.Internal.src.nuspec
34+
VERSION="${GITHUB_REF_NAME#v}"
35+
echo "Packing version: $VERSION"
36+
mkdir -p artifacts
37+
nuget pack ./nuspecs/FastExpressionCompiler.src.nuspec -OutputDirectory artifacts -Version $VERSION -NonInteractive
38+
nuget pack ./nuspecs/FastExpressionCompiler.LightExpression.src.nuspec -OutputDirectory artifacts -Version $VERSION -NonInteractive
39+
nuget pack ./nuspecs/FastExpressionCompiler.Internal.src.nuspec -OutputDirectory artifacts -Version $VERSION -NonInteractive
40+
nuget pack ./nuspecs/FastExpressionCompiler.LightExpression.Internal.src.nuspec -OutputDirectory artifacts -Version $VERSION -NonInteractive
4041
4142
- uses: actions/upload-artifact@v4
4243
with:
4344
name: Packages
4445
path: ./artifacts
4546

46-
# - name: Push with dotnet
47-
# run: dotnet nuget push artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
47+
- name: Push to GitHub Packages
48+
run: |
49+
dotnet nuget add source --username dadhi --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/dadhi/index.json"
50+
dotnet nuget push artifacts/*.nupkg --source github --skip-duplicate
51+
52+
- name: Push to NuGet.org
53+
run: dotnet nuget push artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

0 commit comments

Comments
 (0)