This repository was archived by the owner on Nov 12, 2026. It is now read-only.
Repository navigation
74 lines (68 loc) · 2.17 KB
/
Copy pathbuild-release.yaml
File metadata and controls
74 lines (68 loc) · 2.17 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
name: Build-Release
on:
workflow_dispatch:
inputs:
tag:
description: "tag: git tag you want create. (sample 1.0.0)"
required: true
dry-run:
description: "dry-run: true will never create release/nuget."
required: true
default: false
type: boolean
concurrency:
group: release
cancel-in-progress: false
jobs:
validate-release:
permissions:
contents: read
uses: Cysharp/Actions/.github/workflows/validate-release.yaml@main
with:
tag: ${{ inputs.tag }}
build-dotnet:
needs: [validate-release]
permissions:
contents: read
id-token: write # required for NuGet Trusted Publish
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: Cysharp/Actions/.github/actions/checkout@main
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
with:
dotnet-version: |
6.0.x
# pack nuget
- run: dotnet build -c Release -p:Version=${{ needs.validate-release.outputs.tag }}
- run: dotnet test -c Release --no-build
- run: dotnet pack -c Release --no-build -p:Version=${{ needs.validate-release.outputs.tag }} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -o ./publish
- uses: Cysharp/Actions/.github/actions/upload-artifact@main
with:
name: nuget
path: ./publish
retention-days: 1
create-release:
needs: [validate-release, build-dotnet]
permissions:
contents: write
uses: Cysharp/Actions/.github/workflows/create-release.yaml@main
with:
commit-id: ""
tag: ${{ needs.validate-release.outputs.tag }}
dry-run: ${{ inputs.dry-run }}
secrets: inherit
publish-package:
needs: [validate-release, create-release]
if: ${{ !inputs.dry-run }}
permissions:
contents: read
id-token: write # required for NuGet Trusted Publish in the calling repository
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: Cysharp/Actions/.github/actions/publish-nuget@main
with:
artifact-name: nuget
user: ${{ secrets.NUGET_USER }}
version: ${{ needs.validate-release.outputs.version }}