-
-
Notifications
You must be signed in to change notification settings - Fork 87
102 lines (91 loc) · 2.52 KB
/
lib.yml
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
name: Release
env:
VERSION: '5.3.0'
ASM_VERSION: '5.0.0'
# VERSION_SUFFIX: '-pre.1'
VERSION_SUFFIX: ''
on:
push:
branches:
- master
- '5.3'
pull_request:
branches:
- master
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: run tests
run: dotnet test src/Config.Net.sln -c release --filter Category!=Integration
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Build
run: dotnet build src/Config.Net.sln --configuration Release /p:Version=${{ env.VERSION }} /p:FileVersion=${{ env.VERSION }} /p:AssemblyVersion=${{ env.ASM_VERSION }}
- name: collect artifacts
run: |
mkdir -p artifacts
cp src/Config.Net/bin/Release/*.nupkg artifacts/
echo "${{ env.VERSION }}" >> artifacts/version.txt
cp docs/release-history.md artifacts/
grep -m 2 -B 1000 '^## ' artifacts/release-history.md | tail -n +3 | head -n -2 > artifacts/release-notes.md
cat artifacts/release-notes.md
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: bin
path: artifacts/*
release:
runs-on: ubuntu-latest
needs:
- build
- test
if: github.ref == 'refs/heads/5.3'
steps:
- uses: actions/download-artifact@v4
with:
name: bin
- name: prerelease
if: ${{ env.VERSION_SUFFIX }}
run: echo 'hey'
- name: release
if: ${{ !env.VERSION_SUFFIX }}
run: echo 'hey'
# publish:
# needs:
# - build
# - test
# if: github.ref == 'refs/heads/master'
# runs-on: ubuntu-latest
# environment: nuget
# steps:
# - name: Download a Build Artifact
# uses: actions/download-artifact@v2
# with:
# name: packages
# - name: Push to nuget.org
# run: dotnet nuget push **/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
# - name: Release
# uses: softprops/action-gh-release@v1
# if: github.ref == 'refs/heads/master'
# with:
# tag_name: ${{ env.v }}
# name: ${{ env.v }}
# files: "src/*.zip"
# generate_release_notes: true