-
Notifications
You must be signed in to change notification settings - Fork 53
76 lines (66 loc) · 2.35 KB
/
specflow.actions.docker.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
name: SpecFlow.Actions.Docker
on:
push:
branches:
- main
paths:
- '.github/workflows/specflow.actions.docker.yaml'
- 'Plugins/SpecFlow.Actions.Docker/**'
- 'Plugins/SpecFlow.Actions.Configuration/**'
- 'Plugins/*'
pull_request:
branches:
- main
paths:
- '.github/workflows/specflow.actions.docker.yaml'
- 'Plugins/SpecFlow.Actions.Docker/**'
- 'Plugins/SpecFlow.Actions.Configuration/**'
- 'Plugins/*'
jobs:
build:
runs-on: ubuntu-latest
env:
DOTNET_NOLOGO: true
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
# Authenticates packages to push to GPR
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- run: dotnet build Plugins/SpecFlow.Actions.Docker/SpecFlow.Actions.Docker.sln
- run: dotnet test Plugins/SpecFlow.Actions.Docker/SpecFlow.Actions.Docker.sln -f net6.0
- name: Create the package
run: dotnet pack --configuration Release Plugins/SpecFlow.Actions.Docker/SpecFlow.Actions.Docker.sln
- name: Upload NuGet Package to Artifacts
uses: actions/upload-artifact@v2
with:
name: NuGet-Package
path: |
Plugins/SpecFlow.Actions.Docker/SpecFlow.Actions.Docker/bin/Release/**/*.nupkg
Plugins/SpecFlow.Actions.Configuration/SpecFlow.Actions.Configuration.Generation/bin/Release/**/*.nupkg
release:
runs-on: windows-latest
env:
DOTNET_NOLOGO: true
needs: build
environment: NuGet.org
if: github.ref == 'refs/heads/main'
steps:
# Authenticates packages to push to nuget.org.
# It's only the way to push a package to nuget.org feed for macOS/Linux machines due to API key config store limitations.
- name: Download a single artifact
uses: actions/download-artifact@v2
with:
name: NuGet-Package
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Publish the package to nuget.org
shell: pwsh
env:
NUGET_AUTH_TOKEN: ${{ secrets.SPECFLOW_ACTIONS_NUGET_TOKEN }}
run: dotnet nuget push "**/*.nupkg" -k "$env:NUGET_AUTH_TOKEN" -s "https://api.nuget.org/v3/index.json" --skip-duplicate