Skip to content

Merge remote-tracking branch 'origin/renovate/microsoft.diagnostics.t… #89

Merge remote-tracking branch 'origin/renovate/microsoft.diagnostics.t…

Merge remote-tracking branch 'origin/renovate/microsoft.diagnostics.t… #89

Workflow file for this run

name: .NET Core
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
create:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2
- run: git fetch --prune --unshallow
- name: Setup .NET Core 8
uses: actions/setup-dotnet@608ee757cfcce72c2e91e99aca128e0cae67de87 # v1
with:
dotnet-version: '8.0.x'
- name: Install dependencies
run: dotnet restore
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@31b3198b2de324472547fecec2c0f721b70c38e2 # v0.9.15
with:
versionSpec: '5.11.1'
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/execute@31b3198b2de324472547fecec2c0f721b70c38e2 # v0.9.15
# - name: Setup SonarScanner
# run: dotnet tool install --tool-path artifacts dotnet-sonarscanner
# - name: SonarScanner begin
# run: artifacts/dotnet-sonarscanner begin /k:"Haproxy.AgentCheck" /o:"lucca" /d:sonar.login=${{ secrets.SONAR_TOKEN }} /d:sonar.host.url="https://sonarcloud.io/" /d:sonar.cs.opencover.reportsPaths="./coverage.opencover.xml"
- name: Test
run: dotnet test --no-restore --verbosity minimal /p:CollectCoverage=true /p:CoverletOutput=../ /p:CoverletOutputFormat=opencover --logger:"console;verbosity=detailed"
# - name: SonarScanner end
# run: artifacts/dotnet-sonarscanner end /d:sonar.login=${{ secrets.SONAR_TOKEN }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish win-x64
run: |
dotnet publish Haproxy.AgentCheck/Haproxy.AgentCheck.csproj -r win-x64 --self-contained /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -c Release /p:Version="${{ steps.gitversion.outputs.majorMinorPatch }}" -o artifact/win-x64
zip artifact/Haproxy.AgentCheck.win-x64.${{ steps.gitversion.outputs.majorMinorPatch }}.zip -q -j artifact/win-x64/*
- name: Publish linux-x64
run: |
dotnet publish Haproxy.AgentCheck/Haproxy.AgentCheck.csproj -r linux-x64 --self-contained /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -c Release /p:Version="${{ steps.gitversion.outputs.majorMinorPatch }}" -o artifact/linux-x64
zip artifact/Haproxy.AgentCheck.linux-x64.${{ steps.gitversion.outputs.majorMinorPatch }}.zip -q -j artifact/linux-x64/*
- uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2
with:
name: 'Haproxy.AgentCheck.win10-x64.${{ steps.gitversion.outputs.majorMinorPatch }}.zip'
path: 'artifact/Haproxy.AgentCheck.win-x64.${{ steps.gitversion.outputs.majorMinorPatch }}.zip'
- uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2
with:
name: 'Haproxy.AgentCheck.linux-x64.${{ steps.gitversion.outputs.majorMinorPatch }}.zip'
path: 'artifact/Haproxy.AgentCheck.linux-x64.${{ steps.gitversion.outputs.majorMinorPatch }}.zip'
- name: Create Release on tag
if: startsWith(github.ref, 'refs/tags/v')
id: create_release
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload win-x64
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifact/Haproxy.AgentCheck.win-x64.${{ steps.gitversion.outputs.majorMinorPatch }}.zip
asset_name: Haproxy.AgentCheck.win-x64.${{ steps.gitversion.outputs.majorMinorPatch }}.zip
asset_content_type: application/zip
- name: Upload linux-x64
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifact/Haproxy.AgentCheck.linux-x64.${{ steps.gitversion.outputs.majorMinorPatch }}.zip
asset_name: Haproxy.AgentCheck.linux-x64.${{ steps.gitversion.outputs.majorMinorPatch }}.zip
asset_content_type: application/zip