-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (53 loc) · 1.42 KB
/
build.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
name: cicd
run-name: ubuntu ${{ github.head_ref }}
on:
push:
branches:
- master
pull_request: {}
schedule:
- cron: "5 4 * * *"
workflow_dispatch:
env:
RestoreLockedMode: true
jobs:
build-and-test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Build and test
run: dotnet test
- name: Nuget pack
run: dotnet pack Stryker.Regex.Parser/Stryker.Regex.Parser.csproj --output ${{ github.workspace }}/publish
- name: Upload pipeline artifact
uses: actions/upload-artifact@v4
with:
name: nuget
path: |
${{ github.workspace }}/publish
retention-days: 15
release:
needs: build-and-test
runs-on: ubuntu-latest
if: github.ref_name == github.event.repository.default_branch
environment: nuget
concurrency:
group: nuget
cancel-in-progress: true
steps:
- uses: actions/download-artifact@v4
with:
name: nuget
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Nuget push
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push ${{ github.workspace }}/*.nupkg --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY