Update sonarqube.yml #99
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI & CD | |
on: [push] | |
jobs: | |
build_test_cc: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dotnet-version: [ '6.0.x' ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }} | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore -p:PackAsTool=True | |
- name: Test | |
run: dotnet test -p:coverletOutput=./lcov.info -p:CollectCoverage=true -p:CoverletOutputFormat=lcov | |
- name: Publish the package to nuget | |
run: dotnet nuget push WebBen.CLI/bin/Release/*.nupkg --api-key "${{secrets.NUGET_API_KEY2}}" -s https://api.nuget.org/v3/index.json | |
- uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CC_SECRET }} # not required for public repos | |
directory: WebBen.Tests | |
files: lcov.info | |
name: codecov-umbrella # optional | |
fail_ci_if_error: true # optional (default = false) | |
verbose: true # optional (default = false) | |
publish: | |
permissions: | |
contents: write | |
actions: read | |
checks: write | |
issues: read | |
packages: write | |
pull-requests: read | |
repository-projects: read | |
statuses: read | |
needs: [build_test_cc] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rid: [win-x64, linux-x64, osx-x64] | |
dotnet-version: [ '6.0.x' ] | |
env: | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
NUGET_XMLDOC_MODE: skip | |
steps: | |
- name: Get Latest Release | |
id: get_release | |
uses: joutvhu/[email protected] | |
with: | |
# The name of the owner of the repo. Used to identify the owner of the repository. | |
owner: omerfarukz | |
# The name of the repository. Used to identify the repository on which to release. | |
repo: WebBen | |
# Specify tag instead of using checkout tag. | |
tag_name: release-master | |
throwing: true | |
debug: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v3 | |
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }} | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
- name: Build | |
run: dotnet publish WebBen.CLI/WebBen.CLI.csproj --runtime ${{ matrix.rid }} -o ./bin/${{ matrix.rid }} --configuration Release --self-contained -p:PublishSingleFile=true -p:PublishTrimmed=true -p:PublishReadyToRun=true -p:DebugType=None -p:DebugSymbols=false | |
- name: Zip | |
run: cd ./bin/${{ matrix.rid }} && zip -r ../../${{ matrix.rid }} . | |
- name: Upload Release Asset | |
uses: shogo82148/actions-upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: ./${{ matrix.rid }}.zip | |
asset_name: webben-${{ matrix.rid }}.zip | |
asset_content_type: application/zip | |
overwrite: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |