Fixed templates publishing #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: publish to NuGet | |
on: | |
push: | |
tags: | |
- 'releases/*' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
# This is necessary so that we have the tags. | |
fetch-depth: 0 | |
- name: Set Build Version | |
run: | | |
$version = "$env:GITHUB_REF_NAME".Substring("releases/".Length) | |
$File = ( | |
Select-Xml -XPath "/Project/PropertyGroup[@Label='NuGet']/Version" -Path "Directory.Build.props" | |
)[0].Node | |
$File.InnerText = $version | |
$File.OwnerDocument.Save((Join-Path $PWD.ProviderPath Directory.Build.props)) | |
echo "VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
shell: pwsh | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.401 | |
- name: Install local tools | |
run: dotnet tool restore | |
- name: Run integration tests | |
run: dotnet run --project build/Build.fsproj | |
- name: Pack FSharp.Data.GraphQL.Shared project | |
run: | | |
cd src/FSharp.Data.GraphQL.Shared | |
dotnet pack --no-build --nologo --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget | |
- name: Publish FSharp.Data.GraphQL.Shared project to NuGet | |
run: | | |
dotnet nuget push nuget/FSharp.Data.GraphQL.Shared.${{env.VERSION}}.{nupkg,snupkg} -s "nuget.org" -k ${{secrets.NUGET_SECRET}} --skip-duplicate | |
- name: Pack FSharp.Data.GraphQL.Client project | |
run: | | |
cd src/FSharp.Data.GraphQL.Client | |
dotnet pack --nologo --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget | |
- name: Publish FSharp.Data.GraphQL.Client project to NuGet | |
run: | | |
dotnet nuget push nuget/FSharp.Data.GraphQL.Client.${{env.VERSION}}.{nupkg,snupkg} -s "nuget.org" -k ${{secrets.NUGET_SECRET}} --skip-duplicate | |
- name: Pack FSharp.Data.GraphQL.Server project | |
run: | | |
cd src/FSharp.Data.GraphQL.Server | |
dotnet pack --no-build --nologo --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget | |
- name: Publish FSharp.Data.GraphQL.Server project to NuGet | |
run: | | |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.${{env.VERSION}}.{nupkg,snupkg} -s "nuget.org" -k ${{secrets.NUGET_SECRET}} --skip-duplicate | |
- name: Pack FSharp.Data.GraphQL.Server.Relay project | |
run: | | |
cd src/FSharp.Data.GraphQL.Server.Relay | |
dotnet pack --no-build --nologo --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget | |
- name: Publish FSharp.Data.GraphQL.Server.Relay project to NuGet | |
run: | | |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Relay.${{env.VERSION}}.{nupkg,snupkg} -s "nuget.org" -k ${{secrets.NUGET_SECRET}} --skip-duplicate | |
- name: Pack FSharp.Data.GraphQL.Server.Middleware project | |
run: | | |
cd src/FSharp.Data.GraphQL.Server.Middleware | |
dotnet pack --no-build --nologo --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget | |
- name: Publish FSharp.Data.GraphQL.Server.Middleware project to NuGet | |
run: | | |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Middleware.${{env.VERSION}}.{nupkg,snupkg} -s "nuget.org" -k ${{secrets.NUGET_SECRET}} --skip-duplicate | |
- name: Prepare the sample project to be packed as a project template | |
run: | | |
& "./Prepare template project for packing.ps1" | |
shell: pwsh | |
- name: Pack FSharp.Data.GraphQL.ProjectTemplates template project | |
run: | | |
cd samples | |
dotnet pack --nologo --configuration Release /p:ContinuousIntegrationBuild=true -o ../nuget | |
- name: Publish FSharp.Data.GraphQL.ProjectTemplates project to GitHub | |
run: | | |
$extensions = "nupkg,snupkg" -split ',' | |
$paths = $extensions | ForEach-Object { "nuget/FSharp.Data.GraphQL.ProjectTemplates.2.0.0-beta1.$_" } | |
foreach ($path in $paths) { | |
dotnet nuget push $path -s "nuget.org" -k ${{secrets.NUGET_SECRET}} --skip-duplicate | |
} | |
shell: pwsh |