Skip to content

Commit

Permalink
sync: synced file(s) with prom-client-net/prom-client-tmpl
Browse files Browse the repository at this point in the history
  • Loading branch information
phnx47-bot committed Dec 13, 2024
1 parent 4abbdc8 commit bc993c1
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 74 deletions.
26 changes: 13 additions & 13 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,51 +8,51 @@ repository:

labels:
- name: dependencies
color: 0052CC
color: '0052CC'
description:

- name: bug
color: D73A4A
color: 'D73A4A'
description:

- name: documentation
color: 0075CA
color: '0075CA'
description:

- name: duplicate
color: CFD3D7
color: 'CFD3D7'
description:

- name: enhancement
color: A2EEEF
color: 'A2EEEF'
description:

- name: good first issue
color: 7057FF
color: '7057FF'
description:

- name: help wanted
color: 008672
color: '008672'
description:

- name: invalid
color: E4E669
color: 'E4E669'
description:

- name: question
color: D876E3
color: 'D876E3'
description:

- name: wontfix
color: FFFFFF
color: 'FFFFFF'
description:

- name: vulnerability
color: D1260F
color: 'D1260F'
description:

- name: sync
color: 6E81A3
color: '6E81A3'
description:

branches:
Expand All @@ -61,7 +61,7 @@ branches:
required_pull_request_reviews: null
required_status_checks:
strict: false
contexts: ['Build, Test & Pack (Linux)']
contexts: ['Build, Test & Pack']
enforce_admins: false
required_linear_history: false
restrictions: null
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI Windows
name: Build Win

on:
push:
Expand All @@ -10,7 +10,7 @@ on:
workflow_dispatch:

jobs:
build-windows:
build-win:
name: Build & Test (Windows)
runs-on: windows-2022
steps:
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build

on:
pull_request:
branches:
- "main"
workflow_dispatch:
workflow_call:

jobs:
build:
name: Build, Test & Pack
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Build
run: dotnet build -c Release -p:ContinuousIntegrationBuild=true

- name: Run tests
run: dotnet test --no-build -c Release -p:CollectCoverage=true -e:CoverletOutputFormat=opencover

- name: Publish to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Set Dev version
if: github.ref == 'refs/heads/main'
run: |
version="$(git describe --long --tags | sed 's/^v//;0,/-/s//./')"
if [ -z "${version}" ]; then
version="0.0.0.$(git rev-list --count HEAD)-g$(git rev-parse --short HEAD)"
fi
echo "VERSION=${version}" >> $GITHUB_ENV
- name: Set Release version
if: startsWith(github.ref, 'refs/tags/v')
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV

- name: Pack NuGet artifacts
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: dotnet pack --no-build -c Release -p:PackageVersion="${{ env.VERSION }}"

- name: Upload artifacts
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4
with:
name: nupkgs
path: src/**/*nupkg
66 changes: 7 additions & 59 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,21 @@
name: CI Linux
name: CI

on:
push:
branches:
- "main"
tags:
- "v*"
pull_request:
branches:
- "main"
workflow_dispatch:

jobs:
build-linux:
name: Build, Test & Pack (Linux)
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Build
run: dotnet build -c Release -p:ContinuousIntegrationBuild=true

- name: Run tests
run: dotnet test --no-build -c Release -p:CollectCoverage=true -e:CoverletOutputFormat=opencover

- name: Publish to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Set Dev version
if: github.ref == 'refs/heads/main'
run: |
version="$(git describe --long --tags | sed 's/^v//;0,/-/s//./')"
if [ -z "${version}" ]; then
version="0.0.0.$(git rev-list --count HEAD)-g$(git rev-parse --short HEAD)"
fi
echo "VERSION=${version}" >> $GITHUB_ENV
- name: Set Release version
if: startsWith(github.ref, 'refs/tags/v')
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV

- name: Pack NuGet artifacts
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: dotnet pack --no-build -c Release -p:PackageVersion="${{ env.VERSION }}"

- name: Upload artifacts
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4
with:
name: nupkgs
path: src/**/*nupkg
build:
name: CI Build
uses: ./.github/workflows/build.yml
secrets: inherit

github:
name: Deploy to GitHub
needs: [build-linux]
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
needs: [build]
runs-on: ubuntu-24.04
steps:
- name: Download artifacts
Expand All @@ -79,7 +27,7 @@ jobs:

nuget:
name: Deploy to NuGet
needs: [build-linux]
needs: [build]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-24.04
steps:
Expand Down

0 comments on commit bc993c1

Please sign in to comment.