Skip to content

try fix build

try fix build #35

Workflow file for this run

name: .NET Core
on:
push:
inputs:
version:
description: "Package Version"
required: true
default: "3.1.0.${{ env.GITHUB_RUN_ID }}-alpha"

Check failure on line 8 in .github/workflows/dotnetcore.yml

View workflow run for this annotation

GitHub Actions / .NET Core

Invalid workflow file

The workflow is not valid. .github/workflows/dotnetcore.yml (Line: 8, Col: 18): Unrecognized named-value: 'env'. Located at position 1 within expression: env.GITHUB_RUN_ID .github/workflows/dotnetcore.yml (Line: 14, Col: 18): Unrecognized named-value: 'env'. Located at position 1 within expression: env.GITHUB_RUN_ID
workflow_dispatch:
inputs:
version:
description: "Package Version"
required: true
default: "3.1.0.${{ env.GITHUB_RUN_ID }}-alpha"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core 2.2
uses: actions/setup-dotnet@v3
with:
dotnet-version: 2.2.x
- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x
- name: Setup .NET 6
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Setup .NET 8
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Build with dotnet
run: dotnet build --configuration Release /p:ContinuousIntegrationBuild=true
- name: Test
run: dotnet test src/PostalCodes.UnitTests/PostalCodes.UnitTests.csproj
- name: Create nuget package
run: dotnet pack . -p:PackageVersion=0.0.1-alpha -o out --no-build
- name: Install dotnet-validate
run: dotnet tool install --global dotnet-validate --version 0.0.1-preview.304
- name: Validate NuGet package
run: dotnet-validate package local out/*.nupkg
- name: Publish
if: github.event_name == 'workflow_dispatch'
run: |
dotnet pack . -p:PackageVersion=${{ github.event.inputs.version }} -o .
dotnet nuget push src/PostalCodes/PostalCodes.${{ github.event.inputs.version }}.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
dotnet nuget push src/PostalCodes/PostalCodes.${{ github.event.inputs.version }}.snupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json