-
Notifications
You must be signed in to change notification settings - Fork 74
136 lines (115 loc) · 5.88 KB
/
publish_ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: publish to GitHub
on:
push:
branches:
- dev
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Build Version
run: |
$File = (
Select-Xml -XPath "/Project/PropertyGroup[@Label='NuGet']/Version" -Path "Directory.Build.props"
)[0].Node
$version = "$($File.InnerText)-ci-$Env:GITHUB_RUN_ID"
$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: Add version to global.json
run: |
$version = "8.0.403"
$globalJsonPath = "global.json"
$globalJson = Get-Content -Raw -Path $globalJsonPath | ConvertFrom-Json
if ($null -eq $globalJson.sdk.version) {
$globalJson.sdk | Add-Member -Type NoteProperty -Name version -Value $version
} else {
$globalJson.sdk.version = $version
}
$globalJson | ConvertTo-Json -Depth 10 | Set-Content -Path $globalJsonPath
shell: pwsh
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.403
- name: Add the GitHub source
run: dotnet nuget add source --username USERNAME --password ${{secrets.GITHUB_TOKEN}} --store-password-in-clear-text --name "github.com" "https://nuget.pkg.github.com/fsprojects/index.json"
- name: Install local tools
run: dotnet tool restore
- name: Run integration tests
run: dotnet run --project build/Build.fsproj -- --ci-build
- name: Pack FSharp.Data.GraphQL.Shared project
run: |
cd src/FSharp.Data.GraphQL.Shared
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:IncludeSource=true -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Shared package to GitHub
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Shared.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
- name: Pack FSharp.Data.GraphQL.Client project
run: |
cd src/FSharp.Data.GraphQL.Client
dotnet pack --configuration Release /p:IsNuGet=true /p:IncludeSource=true -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Client package to GitHub
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Client.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
- name: Pack FSharp.Data.GraphQL.Server project
run: |
cd src/FSharp.Data.GraphQL.Server
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:IncludeSource=true -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Server package to GitHub
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
- name: Pack FSharp.Data.GraphQL.Server.AspNetCore project
run: |
cd src/FSharp.Data.GraphQL.Server.AspNetCore
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:IncludeSource=true -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Server.AspNetCore package to GitHub
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.AspNetCore.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
- name: Pack FSharp.Data.GraphQL.Server.Giraffe project
run: |
cd src/FSharp.Data.GraphQL.Server.Giraffe
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:IncludeSource=true -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Server.Giraffe package to GitHub
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Giraffe.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
- name: Pack FSharp.Data.GraphQL.Server.Oxpecker project
run: |
cd src/FSharp.Data.GraphQL.Server.Oxpecker
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:IncludeSource=true -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Server.Oxpecker package to GitHub
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Oxpecker.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
- name: Pack FSharp.Data.GraphQL.Server.Relay project
run: |
cd src/FSharp.Data.GraphQL.Server.Relay
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:IncludeSource=true -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Server.Relay package to GitHub
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Relay.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
- name: Pack FSharp.Data.GraphQL.Server.Middleware project
run: |
cd src/FSharp.Data.GraphQL.Server.Middleware
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:IncludeSource=true -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Server.Middleware package to GitHub
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Middleware.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --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 --configuration Release -o ../nuget
- name: Publish FSharp.Data.GraphQL.ProjectTemplates package to GitHub
run: |
$path = "nuget/FSharp.Data.GraphQL.ProjectTemplates.${{env.VERSION}}.nupkg"
dotnet nuget push $path -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
shell: pwsh