diff --git a/.gitea/workflows/publish-nuget.yaml b/.gitea/workflows/publish-nuget.yaml index c43633f..eeb141d 100644 --- a/.gitea/workflows/publish-nuget.yaml +++ b/.gitea/workflows/publish-nuget.yaml @@ -17,9 +17,6 @@ jobs: uses: https://github.com/actions/setup-dotnet@v3 with: dotnet-version: 8.x - source-url: https://gitea.example.com/api/packages/just/nuget/index.json - env: - NUGET_AUTH_TOKEN: ${{ secrets.NUGET_PACKAGE_TOKEN }} - name: Restore dependencies run: dotnet restore Railway/Railway.csproj @@ -27,11 +24,14 @@ jobs: - name: Build run: dotnet build --no-restore --configuration Release Railway/Railway.csproj + - name: Setup nuget source + run: dotnet nuget add source --name gitea_registry --api-key ${{ secrets.NUGET_PACKAGE_TOKEN }} https://gitea.example.com/api/packages/just/nuget/index.json + - name: Create the package env: RELEASE_VERSION: ${{ gitea.event.release.tag_name }} run: dotnet pack --no-build --configuration Release --output nupkgs Railway/Railway.csproj `echo $RELEASE_VERSION | sed -E 's|^(v([0-9]+(\.[0-9]+){2}))(-([a-z0-9]+)){1}|--property:ReleaseVersion=\2 --property:VersionSuffix=\5|; s|^(v([0-9]+(\.[0-9]+){2}))$|--property:ReleaseVersion=\2|'` - name: Publish the package - run: dotnet nuget push nupkgs/*.nupkg + run: dotnet nuget push --source gitea_registry nupkgs/*.nupkg