name: dotnet-publish-nuget on: [push] env: DOTNET_VERSION: 8.x DOTNET_NUGET_SOURCE_URL: https://git.mworkspace.cn/api/packages/GiteaActionsSample/nuget/index.json jobs: Pack-And-Publish: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: List files in the repos run: ls ${{ gitea.workspace }} && ls $GITEA_WORKSPACE - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: dotnet-version: ${{ env.DOTNET_VERSION }} cache: true source-url: ${{ env.DOTNET_NUGET_SOURCE_URL }} env: NUGET_AUTH_TOKEN: ${{secrets.NUGET_APIKEY}} - name: Install dependencies run: dotnet restore -s https://api.nuget.org/v3/index.json - name: Build run: dotnet build --configuration Release --no-restore - name: Test run: dotnet test --no-restore --verbosity normal - name: Pack run: dotnet pack -c Release --no-restore - name: Publish run: dotnet nuget push bin/Release/*.nupkg