a143553a09
.NET Build and Publish / build (push) Has been cancelled
* .net10 attempt 2 * bump csharpier * drop sln * supress stream analyers for test projects * readme * fix package locks post merge * Microsoft.Extensions.DependencyInjection * Simplify the dependency structure * don't bump graphql client for netstandard and net8 targets * Fix test
58 lines
1.6 KiB
YAML
58 lines
1.6 KiB
YAML
name: .NET Build and Publish
|
|
|
|
on:
|
|
push:
|
|
tags: ["3.*.*"]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: "nuget.org"
|
|
permissions:
|
|
id-token: write # enable GitHub OIDC token issuance for this job
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v5
|
|
with:
|
|
dotnet-version: 10.x.x
|
|
cache: true
|
|
cache-dependency-path: "**/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: NuGet login (OIDC → temp API key)
|
|
uses: NuGet/login@v1
|
|
id: login
|
|
with:
|
|
user: ${{ secrets.NUGET_USER }}
|
|
|
|
- name: Push to nuget.org
|
|
run: dotnet nuget push output/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{steps.login.outputs.NUGET_API_KEY}}
|