-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (81 loc) · 2.4 KB
/
build.yml
File metadata and controls
98 lines (81 loc) · 2.4 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
name: .NET
on:
push:
branches: [ "stable" ]
env:
BUILD_VERSION: 0.2.${{github.run_number}}
SLN_PATH: src/ShellRunner.sln
TEST_PATH: src/TestApp/bin/Release/net8.0/TestApp.dll
PROJECT_PATH: src/ShellRunner/ShellRunner.csproj
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore $SLN_PATH
- name: Build
run: dotnet build $SLN_PATH
-c Release
--no-restore
-p:Version=$BUILD_VERSION
- name: Test
run: dotnet $TEST_PATH bash
- name: Pack-Alpha
run: dotnet pack $PROJECT_PATH
-c Release
--no-restore
--no-build
-p:PackageVersion=$BUILD_VERSION-alpha
-o alpha-packages
- name: Pack-Release
run: dotnet pack $PROJECT_PATH
-c Release
--no-restore
--no-build
-p:PackageVersion=$BUILD_VERSION
-o packages
- name: Upload ShellRunner PreRelease Artifacts
uses: actions/upload-artifact@v4.6.1
with:
name: PreReleaseArtifacts
path: alpha-packages/*.nupkg
if-no-files-found: error
- name: Upload ShellRunner Release Artifacts
uses: actions/upload-artifact@v4.6.1
with:
name: ReleaseArtifacts
path: packages/*.nupkg
if-no-files-found: error
pre-release:
needs: build
name: Deploy Pre-Release Nugets
environment:
name: Integration
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4.1.9
with:
name: PreReleaseArtifacts
- name: Push ShellRunner Pre-Release Nuget
run: dotnet nuget push ./**/*-alpha.nupkg
--api-key ${{secrets.NUGETKEY}} --source https://api.nuget.org/v3/index.json
release:
needs: build
name: Deploy Release Nugets
environment:
name: Production
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4.1.9
with:
name: ReleaseArtifacts
- name: Push ShellRunner Pre-Release Nuget
run: dotnet nuget push ./**/*.nupkg
--api-key ${{secrets.NUGETKEY}} --source https://api.nuget.org/v3/index.json