generated from DbUp/dbup-provider-template
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
3 changed files
with
28 additions
and
76 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 |
---|---|---|
|
@@ -2,84 +2,12 @@ name: CI | |
|
||
on: | ||
push: | ||
branches: | ||
- '**' # Ignores pushes of tags | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest # Use Ubuntu in v5.0 | ||
|
||
env: | ||
DOTNET_NOLOGO: true | ||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Avoid pre-populating the NuGet package cache | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # all | ||
|
||
- name: Setup .NET 2.0 # Remove in v5.0 | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 2.0.x | ||
|
||
- name: Setup .NET 8.0 | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 8.0.x | ||
|
||
- name: Install NuGet | ||
uses: NuGet/[email protected] | ||
|
||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/setup@v0 | ||
with: | ||
versionSpec: '5.x' | ||
|
||
- name: Run GitVersion | ||
id: gitversion | ||
uses: gittools/actions/gitversion/execute@v0 | ||
|
||
- name: Display SemVer | ||
run: | | ||
echo "SemVer: $env:GitVersion_SemVer" | ||
- name: Add DbUp NuGet Source | ||
run: dotnet nuget add source --name DbUp --username DbUp --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text https://nuget.pkg.github.com/DbUp/index.json | ||
|
||
- name: Restore | ||
run: dotnet restore | ||
working-directory: src | ||
|
||
- name: Build | ||
run: dotnet build -c Release --no-restore /p:Version=$env:GitVersion_SemVer | ||
working-directory: src | ||
|
||
- name: Test | ||
run: dotnet test --no-build -c Release --logger trx --logger "console;verbosity=detailed" --results-directory ../artifacts | ||
working-directory: src | ||
|
||
- name: Pack | ||
run: dotnet pack --no-build -c Release -o ../artifacts /p:Version=$env:GitVersion_SemVer | ||
working-directory: src | ||
|
||
- name: Pack placeholder dbup package | ||
run: nuget pack ./dbup/dbup.nuspec -OutputDirectory ../artifacts -Version $env:GitVersion_SemVer | ||
working-directory: src | ||
|
||
- name: Push NuGet packages to GitHub Packages ⬆️ | ||
working-directory: artifacts | ||
run: dotnet nuget push *.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/DbUp/index.json" | ||
|
||
- name: Push NuGet packages to NuGet ⬆️ | ||
if: ${{ steps.gitversion.outputs.preReleaseLabel == '' }} | ||
working-directory: artifacts | ||
run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json | ||
|
||
- name: Test Report 🧪 | ||
uses: dorny/test-reporter@v1 | ||
if: ${{ always() }} | ||
with: | ||
name: Tests | ||
path: artifacts/*.trx | ||
reporter: dotnet-trx | ||
name: Build | ||
uses: DbUp/Universe/.github/workflows/build.yml@main |
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 @@ | ||
name: Publish DbUp Packages to NuGet | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish: | ||
name: Publish Package | ||
uses: DbUp/Universe/.github/workflows/publish-release.yml@main | ||
secrets: inherit |
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 @@ | ||
name: Test Report | ||
run-name: Generate Test Report for workflow ${{ github.event.workflow_run.name }} run ${{ github.event.workflow_run.run_number }} branch ${{ github.event.workflow_run.head_branch }} | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["CI", "build"] | ||
types: [completed] | ||
|
||
jobs: | ||
report: | ||
name: Test Report 🧪 | ||
uses: DbUp/Universe/.github/workflows/test-report.yml@main |