-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Enable GitHub Actions * Main branch is called master in this repo * Ignore .idea * No need to offset builds by 200 * work on build for new project format * add automatic release notes --------- Co-authored-by: EEParker <EEParker@users.noreply.github.com>
- Loading branch information
1 parent
87e782c
commit 55d211c
Showing
16 changed files
with
202 additions
and
78 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# .github/release.yml | ||
|
||
changelog: | ||
exclude: | ||
labels: | ||
- ignore-for-release | ||
authors: | ||
- octocat | ||
categories: | ||
- title: Breaking Changes 🛠 | ||
labels: | ||
- Semver-Beta | ||
- title: Major Update 🛸 | ||
labels: | ||
- Semver-Major | ||
- Feature | ||
- title: New Features 🎉 | ||
labels: | ||
- Semver-Minor | ||
- enhancement | ||
- title: Dependencies 👒 | ||
labels: | ||
- dependencies | ||
- title: Bugfixes 🐛 | ||
labels: | ||
- Semver-Patch | ||
- bug | ||
- title: Other Changes | ||
labels: | ||
- "*" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# If this file is renamed, the incrementing run attempt number will be reset. | ||
|
||
name: CI | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
env: | ||
CI_BUILD_NUMBER: ${{ github.run_number }} | ||
CI_TARGET_BRANCH: ${{ github.head_ref || github.ref_name }} | ||
CI_COMMIT_TAG: ${{ github.ref_name }} | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.0.x | ||
- name: Build and Publish | ||
env: | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | ||
shell: pwsh | ||
run: | | ||
./Build.ps1 | ||
- name: Create Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "artifacts/*.nupkg" | ||
generateReleaseNotes: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# If this file is renamed, the incrementing run attempt number will be reset. | ||
|
||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ "dev", "master" ] | ||
pull_request: | ||
branches: [ "dev", "master" ] | ||
|
||
env: | ||
CI_BUILD_NUMBER: ${{ github.run_number }} | ||
CI_TARGET_BRANCH: ${{ github.head_ref || github.ref_name }} | ||
#CI_COMMIT_TAG: "" | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.0.x | ||
- name: Build and Publish | ||
env: | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | ||
shell: pwsh | ||
run: | | ||
./Build.ps1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,4 +239,5 @@ _Pvt_Extensions | |
|
||
sample/Sample/out/ | ||
|
||
.DS_Store | ||
.DS_Store | ||
.idea |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,80 @@ | ||
$ErrorActionPreference = "Stop" | ||
echo "build: Build started" | ||
Write-Output "build: Build started" | ||
|
||
Push-Location $PSScriptRoot | ||
|
||
Write-Output "build: Tool versions follow" | ||
|
||
dotnet --version | ||
dotnet --list-sdks | ||
|
||
if(Test-Path .\artifacts) { | ||
echo "build: Cleaning .\artifacts" | ||
Remove-Item .\artifacts -Force -Recurse | ||
Write-Output "build: Cleaning ./artifacts" | ||
Remove-Item ./artifacts -Force -Recurse | ||
} | ||
|
||
& dotnet restore --no-cache | ||
& dotnet restore .\serilog-sinks-splunk.sln --no-cache | ||
|
||
$branch = $NULL -ne $env:CI_TARGET_BRANCH ? $env:CI_TARGET_BRANCH : (git symbolic-ref --short -q HEAD) | ||
$revision = $NULL -ne $env:CI_BUILD_NUMBER ? "{0:00000}" -f [Convert]::ToInt32("0" + $env:CI_BUILD_NUMBER, 10) : "local" | ||
|
||
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL]; | ||
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL]; | ||
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"] | ||
$commitHash = $(git rev-parse --short HEAD) | ||
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""] | ||
# add a suffix if this is not a tag build | ||
$suffix = $NULL -ne $env:CI_COMMIT_TAG ? "" : "$($branch.Substring(0, [Math]::Min(10,$branch.Length)) -replace '([^a-zA-Z0-9\-]*)', '')-$revision" | ||
$prefix = $NULL -ne $env:CI_COMMIT_TAG ? $env:CI_COMMIT_TAG : $NULL | ||
|
||
echo "build: Package version suffix is $suffix" | ||
echo "build: Build version suffix is $buildSuffix" | ||
Write-Output $brach | ||
Write-Output $revision | ||
Write-Output $suffix | ||
|
||
foreach ($src in ls src/*) { | ||
Write-Output "build: Package version suffix is $suffix" | ||
|
||
|
||
foreach ($src in Get-ChildItem src/*) { | ||
Push-Location $src | ||
|
||
echo "build: Packaging project in $src" | ||
Write-Output "build: Packaging project in $src" | ||
|
||
& dotnet build -c Release --version-suffix=$buildSuffix | ||
if ($suffix) { | ||
& dotnet pack -c Release --include-symbols -o ..\..\artifacts --version-suffix=$suffix --no-build | ||
if ($prefix) { | ||
# release build | ||
& dotnet pack -c Release -o ../../artifacts --version-prefix=$prefix | ||
} elseif ($suffix) { | ||
# prerelease build | ||
& dotnet pack -c Release -o ../../artifacts --version-suffix=$suffix | ||
} else { | ||
& dotnet pack -c Release --include-symbols -o ..\..\artifacts --no-build | ||
# local build | ||
& dotnet pack -c Release -o ../../artifacts | ||
} | ||
if($LASTEXITCODE -ne 0) { exit 1 } | ||
if($LASTEXITCODE -ne 0) { throw "Packaging failed" } | ||
|
||
Pop-Location | ||
} | ||
|
||
foreach ($test in ls test/*.Tests) { | ||
Write-Output "build: Checking complete solution builds" | ||
& dotnet build .\serilog-sinks-splunk.sln -c Release | ||
if($LASTEXITCODE -ne 0) { throw "Solution build failed" } | ||
|
||
|
||
foreach ($test in Get-ChildItem test/*.Tests) { | ||
Push-Location $test | ||
|
||
echo "build: Testing project in $test" | ||
Write-Output "build: Testing project in $test" | ||
|
||
& dotnet test -c Release | ||
if($LASTEXITCODE -ne 0) { exit 3 } | ||
if($LASTEXITCODE -ne 0) { throw "Testing failed" } | ||
|
||
Pop-Location | ||
} | ||
|
||
dotnet build -c Release .\sample\Sample\Sample.csproj | ||
|
||
Pop-Location | ||
|
||
if ($env:NUGET_API_KEY -and ($NULL -ne $suffix -or $NULL -ne $prefix)) { | ||
# GitHub Actions will only supply this to branch builds and not PRs. We publish | ||
# builds from any branch this action targets (i.e. master and dev). | ||
|
||
Write-Output "build: Publishing NuGet packages" | ||
|
||
foreach ($nupkg in Get-ChildItem artifacts/*.nupkg) { | ||
Write-Output "build: Publishing $nupkg" | ||
& dotnet nuget push -k $env:NUGET_API_KEY -s https://api.nuget.org/v3/index.json "$nupkg" --no-symbols | ||
if($LASTEXITCODE -ne 0) { throw "Publishing failed" } | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
$ErrorActionPreference = "Stop" | ||
|
||
$RequiredDotnetVersion = $(cat ./global.json | convertfrom-json).sdk.version | ||
|
||
New-Item -ItemType Directory -Force "./build/" | Out-Null | ||
|
||
Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile "./build/installcli.ps1" | ||
& ./build/installcli.ps1 -InstallDir "$pwd/.dotnetcli" -NoPath -Version $RequiredDotnetVersion | ||
if ($LASTEXITCODE) { throw ".NET install failed" } |
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"sdk": { | ||
"version": "8.0.201", | ||
"rollForward": "latestPatch" | ||
} | ||
} |
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
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
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
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
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
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