name: .NET Build and Publish on: push: tags: ["3.*"] jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v5 - name: Setup .NET uses: actions/setup-dotnet@v5 with: dotnet-version: 8.x.x - uses: actions/cache@v4 with: path: ~/.nuget/packages key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} - id: set-version name: Set version to output run: | TAG=${{ github.ref_name }} if [[ "${{ github.ref }}" != refs/tags/* ]]; then TAG="3.0.99.${{ github.run_number }}" fi SEMVER="${TAG}" FILE_VERSION=$(echo "$TAG" | sed -E 's/^([0-9]+\.[0-9]+\.[0-9]+).*/\1/') FILE_VERSION="$FILE_VERSION.${{ github.run_number }}" echo "semver=$SEMVER" >> "$GITHUB_OUTPUT" echo "fileVersion=$FILE_VERSION" >> "$GITHUB_OUTPUT" echo $SEMVER echo $FILE_VERSION - name: 🔫 Build and Pack run: ./build.sh pack env: SEMVER: ${{ steps.set-version.outputs.SEMVER }} FILE_VERSION: ${{ steps.set-version.outputs.FILE_VERSION }} - name: Upload coverage reports to Codecov with GitHub Action uses: codecov/codecov-action@v5 with: files: tests/**/coverage.xml token: ${{ secrets.CODECOV_TOKEN }} - name: Push to nuget.org run: dotnet nuget push output/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{secrets.CONNECTORS_NUGET_TOKEN }} --skip-duplicate