Repository navigation
88 lines (73 loc) · 2.07 KB
/
Copy pathrelease-beta.yml
File metadata and controls
88 lines (73 loc) · 2.07 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
name: Publish beta NuGet package
on:
workflow_dispatch:
permissions:
contents: write
issues: write
pull-requests: write
packages: write
jobs:
check:
runs-on: ubuntu-latest
name: Check release
environment: AsyncAPI
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v3
with:
dry_run: true
ci: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
version: ${{ steps.semantic.outputs.new_release_version }}
pre-release:
runs-on: ubuntu-latest
name: Publish NuGet packages
needs: check
environment: AsyncAPI
permissions:
contents: read
id-token: write
strategy:
matrix:
package-name:
- ByteBard.AsyncAPI
- ByteBard.AsyncAPI.Readers
- ByteBard.AsyncAPI.Bindings
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- run: echo ${{ env.GITHUB_RUN_NUMBER_WITH_OFFSET }}
- name: Build ${{ matrix.package-name }} project and pack NuGet package
run: >
dotnet pack
src/${{ matrix.package-name }}/${{ matrix.package-name }}.csproj
-c Release
-o out-${{ matrix.package-name }}
-p:PackageVersion=${{ needs.check.outputs.version }}-beta.${{ github.run_number }}
- name: Authenticate to NuGet
uses: NuGet/login@v1
id: nuget-login
with:
user: VisualBean
- name: Push generated package to nuget.org
env:
NUGET_API_KEY: ${{ steps.nuget-login.outputs.NUGET_API_KEY }}
run: >
dotnet nuget push
out-${{ matrix.package-name }}/*.nupkg
--source https://api.nuget.org/v3/index.json
--skip-duplicate
--no-symbols
--api-key "$NUGET_API_KEY"