Repository navigation
97 lines (84 loc) · 3.01 KB
/
Copy pathrelease.yaml
File metadata and controls
97 lines (84 loc) · 3.01 KB
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
on:
repository_dispatch:
types: [release]
workflow_dispatch:
inputs:
tag:
description: Release to build, such as v1.22.1 or nightly. Defaults to the latest release.
required: false
type: string
default: ""
version_postfix:
description: Additional string to concatenate onto the existing version before release
required: false
type: string
default: ""
name: Release
permissions:
contents: read
concurrency:
group: release
queue: max
jobs:
build:
uses: ./.github/workflows/ci.yaml
with:
ref: ${{ github.sha }}
tag: ${{ inputs.tag }}
version_postfix: ${{ inputs.version_postfix }}
publish:
needs: build
if: github.repository == 'vrchatapi/vrchatapi-csharp'
runs-on: ubuntu-latest
permissions:
contents: write # Push the generated SDK back to main
id-token: write # OIDC token exchanged for a short-lived NuGet API key
steps:
- uses: actions/checkout@v7
# The artifact is overlaid onto the checkout rather than replacing it, so anything the
# generator stops emitting would otherwise survive in src/ forever.
- run: rm -rf src
- uses: actions/download-artifact@v8
with:
name: csharp-generated
- run: rm -f openapi-3.1.json
- uses: actions/setup-dotnet@v6
with:
dotnet-version: "8.0.x"
- uses: JamesIves/github-pages-deploy-action@v4.9.0
with:
branch: main
folder: .
commit-message: Upgrade .NET SDK to spec ${{ needs.build.outputs.version }}
- if: github.event_name == 'repository_dispatch'
name: Pack packages
run: |
dotnet pack src/VRChat.API/VRChat.API.csproj \
--configuration Release \
--output artifacts \
-p:IncludeSymbols=true \
-p:SymbolPackageFormat=snupkg
dotnet pack wrapper/VRChat.API.Extensions.Hosting/VRChat.API.Extensions.Hosting.csproj \
--configuration Release \
--output artifacts \
-p:IncludeSymbols=true \
-p:SymbolPackageFormat=snupkg
# Trusted Publishing: exchange the GitHub OIDC token for an API key that is
# valid for one hour, so this must stay right before the push.
- if: github.event_name == 'repository_dispatch'
name: NuGet login (OIDC -> temporary API key)
id: nuget-login
uses: NuGet/login@v1
with:
user: ${{ secrets.NUGET_USER }}
- if: github.event_name == 'repository_dispatch'
name: Push packages to NuGet
run: |
dotnet nuget push "artifacts/*.nupkg" \
--api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
dotnet nuget push "artifacts/*.snupkg" \
--api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate