-
Notifications
You must be signed in to change notification settings - Fork 2
124 lines (107 loc) · 3.21 KB
/
release.yaml
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
name: Release
on:
release:
types:
- released
env:
RUNNER_DIR: ./TmsRunner
NUGET_DIR: ./nuget
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
project: [
./Tms.Adapter,
./Tms.Adapter.Core,
./Tms.Adapter.XUnit,
./Tms.Adapter.SpecFlowPlugin
]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore ${{ matrix.project }}
- name: Build project
run: |
dotnet build --configuration Release \
--no-restore ${{ matrix.project }}
- name: Create NuGet package
run: |
dotnet pack --configuration Release \
--no-build --output ${{ env.NUGET_DIR }} \
${{ matrix.project }}
- name: Save artifacts
uses: actions/upload-artifact@v3
with:
name: NuGet-package
path: ${{ env.NUGET_DIR }}/*.nupkg
publish:
runs-on: ubuntu-latest
needs: [ build ]
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: NuGet-package
path: ${{ env.NUGET_DIR }}
- name: Publish to NuGet.org
run: |
dotnet nuget push ${{ env.NUGET_DIR }}/*.nupkg \
--skip-duplicate \
--source https://api.nuget.org/v3/index.json \
--api-key ${{ secrets.NUGET_PUBLISH_KEY }}
- name: Publish to GitHub Packages
run: |
dotnet nuget push ${{ env.NUGET_DIR }}/*.nupkg \
--skip-duplicate \
--source https://nuget.pkg.github.com/testit-tms/index.json \
--api-key ${{ secrets.GITHUB_TOKEN }}
runner_build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os: win-x64
artifact_name: TmsRunner.exe
asset_name: TmsRunner-win-x64-${{ github.event.release.tag_name }}.exe
- os: linux-x64
artifact_name: TmsRunner
asset_name: TmsRunner-linux-x64-${{ github.event.release.tag_name }}
- os: osx-x64
artifact_name: TmsRunner
asset_name: TmsRunner-osx-x64-${{ github.event.release.tag_name }}
needs: [ publish ]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore ${{ env.RUNNER_DIR }}
- name: Publish project
run: |
dotnet publish \
-r ${{ matrix.os }} \
--configuration Release \
--self-contained true \
--output ./publish \
--no-restore ${{ env.RUNNER_DIR }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: publish/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
overwrite: true