From 7c7e23dbb73f20a858dd7f7f6a4447658fc8e822 Mon Sep 17 00:00:00 2001 From: John Smith Date: Thu, 16 Jul 2026 09:47:08 +0100 Subject: [PATCH] ci: remove deprecated Node action runtimes --- .github/workflows/ci.yml | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1d1bc7..34953b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,9 @@ name: CI +permissions: + contents: write + on: push: branches: @@ -33,10 +36,10 @@ jobs: steps: - name: checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: setup .net core sdk - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 with: dotnet-version: | 8.0.x @@ -54,13 +57,26 @@ jobs: - name: Publish NuGet if: github.event_name == 'push' && github.ref == 'refs/heads/master' - uses: alirezanet/publish-nuget@v3.1.0 - with: - PROJECT_FILE_PATH: src/solrevdev.seedfolder.csproj # Relative to repository root - # VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file - # VERSION_REGEX: (.*)<\/Version> # Regex pattern to extract version info in a capturing group - # TAG_COMMIT: true # Flag to enable / disable git tagging - # TAG_FORMAT: v* # Format of the git tag, [*] gets replaced with version - NUGET_KEY: ${{secrets.NUGET_API_KEY}} # nuget.org API key - PACKAGE_NAME: solrevdev.seedfolder + env: + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + run: | + version=$(sed -n 's:.*\(.*\).*:\1:p' src/solrevdev.seedfolder.csproj) + package="src/nupkg/solrevdev.seedfolder.${version}.nupkg" + tag="v${version}" + + if [[ -z "$version" || ! -f "$package" ]]; then + echo "Unable to find the package version or package file." >&2 + exit 1 + fi + + dotnet nuget push "$package" \ + --api-key "$NUGET_API_KEY" \ + --source https://api.nuget.org/v3/index.json \ + --skip-duplicate + if git ls-remote --exit-code --tags origin "refs/tags/${tag}" >/dev/null 2>&1; then + echo "Tag ${tag} already exists; no tag update needed." + else + git tag "$tag" + git push origin "$tag" + fi