All checks were successful
Branch Build / build-test-deploy (push) Successful in 2m22s
70 lines
2.0 KiB
YAML
70 lines
2.0 KiB
YAML
name: Core Build
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
env:
|
|
TZ: 'Europe/Berlin'
|
|
LANG: 'de'
|
|
CONFIGURATION: 'Release'
|
|
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
|
CI_COMMIT_TAG: ${{ gitea.ref_name }}
|
|
|
|
jobs:
|
|
build-test-deploy:
|
|
runs-on: ubuntu
|
|
steps:
|
|
- name: Checkout repository code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup dotnet
|
|
uses: actions/setup-dotnet@v5
|
|
with:
|
|
dotnet-version: 10.x
|
|
cache: false
|
|
|
|
- name: Restore dependencies
|
|
run: |
|
|
set -ex
|
|
dotnet restore -v q
|
|
echo "CI_SERVER_HOST=${GITEA_SERVER_URL#https://}" >> "$GITEA_ENV"
|
|
|
|
- name: Setup tools
|
|
run: |
|
|
set -ex
|
|
dotnet tool install dotnet-reportgenerator-globaltool --tool-path /dotnet-tools
|
|
|
|
- name: Build solution
|
|
shell: bash
|
|
run: |
|
|
set -ex
|
|
shopt -s globstar
|
|
mkdir /artifacts
|
|
dotnet build -c ${CONFIGURATION} --no-restore --nologo src/Cloudflare/Cloudflare.csproj
|
|
mv ./src/Cloudflare/**/*.nupkg /artifacts/
|
|
mv ./src/Cloudflare/**/*.snupkg /artifacts/
|
|
|
|
- name: Test solution
|
|
run: |
|
|
set -ex
|
|
dotnet test -c ${CONFIGURATION} --no-build --nologo /p:CoverletOutputFormat=Cobertura test/Cloudflare.Tests/Cloudflare.Tests.csproj
|
|
/dotnet-tools/reportgenerator "-reports:${{ gitea.workspace }}/**/coverage.cobertura.xml" "-targetdir:/reports" "-reportType:TextSummary"
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: artifacts
|
|
path: |
|
|
/reports/Summary.txt
|
|
|
|
- name: Publish packages
|
|
env:
|
|
NUGET_APIKEY: ${{ secrets.NUGET_APIKEY }}
|
|
run: |
|
|
set -ex
|
|
dotnet nuget push -k ${NUGET_APIKEY} -s https://api.nuget.org/v3/index.json --skip-duplicate /artifacts/*.nupkg
|