-
Notifications
You must be signed in to change notification settings - Fork 0
169 lines (143 loc) · 4.85 KB
/
Build.yml
File metadata and controls
169 lines (143 loc) · 4.85 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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Build
on:
workflow_dispatch:
release:
types: [ released ]
push:
branches:
- 'main'
- 'feature/**'
- 'patch/**'
jobs:
SetupBuildInfo:
runs-on: ubuntu-latest
outputs:
build-name: ${{ steps.SetupBuildInfo.outputs.build-name }}
build-id: ${{ steps.SetupBuildInfo.outputs.build-id }}
build-version: ${{ steps.SetupBuildInfo.outputs.build-version }}
build-timestamp: ${{ steps.SetupBuildInfo.outputs.build-timestamp }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: SetupBuildInfo
id: SetupBuildInfo
run: dotnet run --project _atom/_atom.csproj SetupBuildInfo --skip --headless
Pack:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Pack
id: Pack
run: dotnet run --project _atom/_atom.csproj Pack --skip --headless
- name: Upload DecSm.Rez
uses: actions/upload-artifact@v4
with:
name: DecSm.Rez
path: "${{ github.workspace }}/.github/publish/DecSm.Rez"
- name: Upload DecSm.Rez.Configuration
uses: actions/upload-artifact@v4
with:
name: DecSm.Rez.Configuration
path: "${{ github.workspace }}/.github/publish/DecSm.Rez.Configuration"
Test:
strategy:
matrix:
job-runs-on: [ windows-latest, ubuntu-latest, macos-latest ]
test-framework: [ net8.0, net9.0, net10.0 ]
runs-on: ${{ matrix.job-runs-on }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Test
id: Test
run: dotnet run --project _atom/_atom.csproj Test --skip --headless
env:
job-runs-on: ${{ matrix.job-runs-on }}
test-framework: ${{ matrix.test-framework }}
build-slice: ${{ matrix.job-runs-on }}-${{ matrix.test-framework }}
- name: Upload DecSm.Rez.Tests
uses: actions/upload-artifact@v4
with:
name: DecSm.Rez.Tests-${{ matrix.job-runs-on }}-${{ matrix.test-framework }}
path: "${{ github.workspace }}/.github/publish/DecSm.Rez.Tests"
PushToNuget:
needs: [ Test, Pack ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Download DecSm.Rez
uses: actions/download-artifact@v4
with:
name: DecSm.Rez
path: "${{ github.workspace }}/.github/artifacts/DecSm.Rez"
- name: Download DecSm.Rez.Configuration
uses: actions/download-artifact@v4
with:
name: DecSm.Rez.Configuration
path: "${{ github.workspace }}/.github/artifacts/DecSm.Rez.Configuration"
- name: PushToNuget
id: PushToNuget
run: dotnet run --project _atom/_atom.csproj PushToNuget --skip --headless
env:
nuget-push-api-key: ${{ secrets.NUGET_PUSH_API_KEY }}
PushToRelease:
needs: [ Pack, Test, SetupBuildInfo ]
runs-on: ubuntu-latest
if: contains(needs.SetupBuildInfo.outputs.build-version, '-') == false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Download DecSm.Rez
uses: actions/download-artifact@v4
with:
name: DecSm.Rez
path: "${{ github.workspace }}/.github/artifacts/DecSm.Rez"
- name: Download DecSm.Rez.Configuration
uses: actions/download-artifact@v4
with:
name: DecSm.Rez.Configuration
path: "${{ github.workspace }}/.github/artifacts/DecSm.Rez.Configuration"
- name: Download DecSm.Rez.Tests
uses: actions/download-artifact@v4
with:
name: DecSm.Rez.Tests
path: "${{ github.workspace }}/.github/artifacts/DecSm.Rez.Tests"
- name: PushToRelease
id: PushToRelease
run: dotnet run --project _atom/_atom.csproj PushToRelease --skip --headless
env:
build-version: ${{ needs.SetupBuildInfo.outputs.build-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}