Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 32 additions & 9 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ on:
types: [closed]

env:
PROJECT_PATH: "SentimentAnalyzer/SentimentAnalyzer.csproj"
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}/output
NUGET_SOURCE_URL: "https://api.nuget.org/v3/index.json"

jobs:
merge-PR:
if: github.event.pull_request.merged == true
runs-on: "ubuntu-latest"
environment: production
permissions:
id-token: write # Enable OIDC for Trusted Publishing
contents: read
steps:
- name: "Checkout"
uses: actions/checkout@v4
Expand All @@ -22,14 +25,34 @@ jobs:
with:
dotnet-version: "10.0.x"

- name: "Restore packages"
run: dotnet restore ${{ env.PROJECT_PATH }}
- name: "Restore solution"
run: dotnet restore

- name: "Build project"
run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release
- name: "Build solution"
run: dotnet build --no-restore --configuration Release

- name: "Pack project"
run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --configuration Release --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
# Pack all four NuGet packages
- name: "Pack SentimentAnalyzer (legacy)"
run: dotnet pack SentimentAnalyzer/SentimentAnalyzer.csproj --no-restore --no-build --configuration Release --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}

- name: "Push package"
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}/*.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL }}
- name: "Pack SentimentAnalyzer.Core"
run: dotnet pack SentimentAnalyzer.Core/SentimentAnalyzer.Core.csproj --no-restore --no-build --configuration Release --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}

- name: "Pack SentimentAnalyzer.Onnx"
run: dotnet pack SentimentAnalyzer.Onnx/SentimentAnalyzer.Onnx.csproj --no-restore --no-build --configuration Release --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}

- name: "Pack SentimentAnalyzer.Onnx.Multilingual"
run: dotnet pack SentimentAnalyzer.Onnx.Multilingual/SentimentAnalyzer.Onnx.Multilingual.csproj --no-restore --no-build --configuration Release --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}

- name: "List packages"
run: ls -la ${{ env.PACKAGE_OUTPUT_DIRECTORY }}

- name: "NuGet login (Trusted Publishing)"
uses: NuGet/login@v1
id: nuget-login
with:
user: arafat

# Push all packages (*.nupkg will match all three)
- name: "Push packages"
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}/*.nupkg --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} --source ${{ env.NUGET_SOURCE_URL }}
57 changes: 47 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,50 @@
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
################################################################################

/.vs/slnx.sqlite
/.vs/ProjectSettings.json
/.vs/SentimentAnalyzer/v16
/.vs
/SentimentAnalyzer/bin/Debug
/SentimentAnalyzer/obj
/SentimentAnalyzer.Tests/obj
/SentimentAnalyzer.Tests/bin/Debug/netcoreapp3.1
/SentimentAnalyzer/.vs/SentimentAnalyzer
/SentimentAnalyzer/bin/Release/netstandard2.0
# Visual Studio
/.vs/
.vs/
*.user
*.suo
*.userosscache
*.sln.docstates

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Aa]rm/
[Aa]rm64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/

# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/

# NuGet
*.nupkg
*.snupkg
**/packages/*
!**/packages/build/

# Test results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
*.trx

# Temporary files
*.csx
*.tmp
*.temp
QuickTest/

# Model cache (for development)
*.onnx.bak
Loading
Loading