-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cc7d69c
Showing
16 changed files
with
1,247 additions
and
0 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,12 @@ | ||
{ | ||
"version": 1, | ||
"isRoot": true, | ||
"tools": { | ||
"dotnet-format": { | ||
"version": "5.0.211103", | ||
"commands": [ | ||
"dotnet-format" | ||
] | ||
} | ||
} | ||
} |
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,67 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
|
||
# Enforces the consistency of code formatting using `.editorconfig` and the `dotnet-format` tool. | ||
check-format: | ||
if: github.event_name == 'push' || github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Restore tools | ||
run: dotnet tool restore | ||
- name: Check format | ||
run: dotnet format --check --folder T4.Build | ||
|
||
build: | ||
if: github.event_name == 'push' || github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
- name: Setup .NET Core SDK | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 5.0.201 | ||
- name: Pin .NET Core SDK | ||
run: dotnet new globaljson --sdk-version 5.0.201 | ||
- name: Create package | ||
shell: pwsh | ||
run: | | ||
if ("${{ github.ref }}" -like "refs/tags/v*") { | ||
$tag = "${{ github.ref }}".SubString(11) | ||
$version = (Select-Xml -path T4.Build/T4.Build.csproj -XPath "/Project/PropertyGroup/VersionPrefix/text()").node.Value | ||
if (-not ($tag -eq $version)) { | ||
echo "There is a mismatch between the project version ($version) and the tag ($tag)" | ||
exit 1 | ||
} | ||
} else { | ||
$suffix = 'g' + $(git rev-parse --short HEAD) | ||
$params = "--version-suffix", $suffix | ||
} | ||
dotnet pack --configuration=Release @params | ||
- name: Upload NuGet package artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: nuget-package | ||
path: T4.Build/bin/Release/T4.Build.*.nupkg | ||
|
||
publish: | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
needs: [check-format, build] | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Download NuGet package artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: nuget-package | ||
- name: Publish to NuGet | ||
run: dotnet nuget push T4.Build.*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json |
Oops, something went wrong.