Skip to content

Commit 9741468

Browse files
committed
sync: synced file(s) with prom-client-net/prom-client-tmpl
1 parent 5fc7fba commit 9741468

File tree

4 files changed

+83
-74
lines changed

4 files changed

+83
-74
lines changed

.github/settings.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,51 +8,51 @@ repository:
88

99
labels:
1010
- name: dependencies
11-
color: 0052CC
11+
color: '0052CC'
1212
description:
1313

1414
- name: bug
15-
color: D73A4A
15+
color: 'D73A4A'
1616
description:
1717

1818
- name: documentation
19-
color: 0075CA
19+
color: '0075CA'
2020
description:
2121

2222
- name: duplicate
23-
color: CFD3D7
23+
color: 'CFD3D7'
2424
description:
2525

2626
- name: enhancement
27-
color: A2EEEF
27+
color: 'A2EEEF'
2828
description:
2929

3030
- name: good first issue
31-
color: 7057FF
31+
color: '7057FF'
3232
description:
3333

3434
- name: help wanted
35-
color: 008672
35+
color: '008672'
3636
description:
3737

3838
- name: invalid
39-
color: E4E669
39+
color: 'E4E669'
4040
description:
4141

4242
- name: question
43-
color: D876E3
43+
color: 'D876E3'
4444
description:
4545

4646
- name: wontfix
47-
color: FFFFFF
47+
color: 'FFFFFF'
4848
description:
4949

5050
- name: vulnerability
51-
color: D1260F
51+
color: 'D1260F'
5252
description:
5353

5454
- name: sync
55-
color: 6E81A3
55+
color: '6E81A3'
5656
description:
5757

5858
branches:
@@ -61,7 +61,7 @@ branches:
6161
required_pull_request_reviews: null
6262
required_status_checks:
6363
strict: false
64-
contexts: ['Build, Test & Pack (Linux)']
64+
contexts: ['Build, Test & Pack']
6565
enforce_admins: false
6666
required_linear_history: false
6767
restrictions: null

.github/workflows/ci-win.yml renamed to .github/workflows/build-win.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI Windows
1+
name: Build Win
22

33
on:
44
push:
@@ -10,7 +10,7 @@ on:
1010
workflow_dispatch:
1111

1212
jobs:
13-
build-windows:
13+
build-win:
1414
name: Build & Test (Windows)
1515
runs-on: windows-2022
1616
steps:

.github/workflows/build.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "main"
7+
workflow_dispatch:
8+
workflow_call:
9+
10+
jobs:
11+
build:
12+
name: Build, Test & Pack
13+
runs-on: ubuntu-24.04
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v4
22+
with:
23+
dotnet-version: |
24+
6.0.x
25+
8.0.x
26+
27+
- name: Build
28+
run: dotnet build -c Release -p:ContinuousIntegrationBuild=true
29+
30+
- name: Run tests
31+
run: dotnet test --no-build -c Release -p:CollectCoverage=true -e:CoverletOutputFormat=opencover
32+
33+
- name: Publish to Codecov
34+
uses: codecov/codecov-action@v5
35+
with:
36+
fail_ci_if_error: true
37+
token: ${{ secrets.CODECOV_TOKEN }}
38+
39+
- name: Set Dev version
40+
if: github.ref == 'refs/heads/main'
41+
run: |
42+
version="$(git describe --long --tags | sed 's/^v//;0,/-/s//./')"
43+
if [ -z "${version}" ]; then
44+
version="0.0.0.$(git rev-list --count HEAD)-g$(git rev-parse --short HEAD)"
45+
fi
46+
echo "VERSION=${version}" >> $GITHUB_ENV
47+
48+
- name: Set Release version
49+
if: startsWith(github.ref, 'refs/tags/v')
50+
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
51+
52+
- name: Pack NuGet artifacts
53+
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
54+
run: dotnet pack --no-build -c Release -p:PackageVersion="${{ env.VERSION }}"
55+
56+
- name: Upload artifacts
57+
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: nupkgs
61+
path: src/**/*nupkg

.github/workflows/ci.yml

Lines changed: 7 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,21 @@
1-
name: CI Linux
1+
name: CI
22

33
on:
44
push:
55
branches:
66
- "main"
77
tags:
88
- "v*"
9-
pull_request:
10-
branches:
11-
- "main"
12-
workflow_dispatch:
139

1410
jobs:
15-
build-linux:
16-
name: Build, Test & Pack (Linux)
17-
runs-on: ubuntu-24.04
18-
steps:
19-
- name: Checkout
20-
uses: actions/checkout@v4
21-
with:
22-
fetch-depth: 0
23-
24-
- name: Setup .NET
25-
uses: actions/setup-dotnet@v4
26-
with:
27-
dotnet-version: |
28-
6.0.x
29-
8.0.x
30-
31-
- name: Build
32-
run: dotnet build -c Release -p:ContinuousIntegrationBuild=true
33-
34-
- name: Run tests
35-
run: dotnet test --no-build -c Release -p:CollectCoverage=true -e:CoverletOutputFormat=opencover
36-
37-
- name: Publish to Codecov
38-
uses: codecov/codecov-action@v5
39-
with:
40-
fail_ci_if_error: true
41-
token: ${{ secrets.CODECOV_TOKEN }}
42-
43-
- name: Set Dev version
44-
if: github.ref == 'refs/heads/main'
45-
run: |
46-
version="$(git describe --long --tags | sed 's/^v//;0,/-/s//./')"
47-
if [ -z "${version}" ]; then
48-
version="0.0.0.$(git rev-list --count HEAD)-g$(git rev-parse --short HEAD)"
49-
fi
50-
echo "VERSION=${version}" >> $GITHUB_ENV
51-
52-
- name: Set Release version
53-
if: startsWith(github.ref, 'refs/tags/v')
54-
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
55-
56-
- name: Pack NuGet artifacts
57-
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
58-
run: dotnet pack --no-build -c Release -p:PackageVersion="${{ env.VERSION }}"
59-
60-
- name: Upload artifacts
61-
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
62-
uses: actions/upload-artifact@v4
63-
with:
64-
name: nupkgs
65-
path: src/**/*nupkg
11+
build:
12+
name: CI Build
13+
uses: ./.github/workflows/build.yml
14+
secrets: inherit
6615

6716
github:
6817
name: Deploy to GitHub
69-
needs: [build-linux]
70-
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
18+
needs: [build]
7119
runs-on: ubuntu-24.04
7220
steps:
7321
- name: Download artifacts
@@ -79,7 +27,7 @@ jobs:
7927

8028
nuget:
8129
name: Deploy to NuGet
82-
needs: [build-linux]
30+
needs: [build]
8331
if: startsWith(github.ref, 'refs/tags/v')
8432
runs-on: ubuntu-24.04
8533
steps:

0 commit comments

Comments
 (0)