Merge branch 'pr/252' #401
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: .NET | |
on: | |
push: | |
branches: [ main, dev/* ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: '5.x' | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: | | |
6.0.x | |
7.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
working-directory: uSync.Migrations | |
- name: Determine Version with GitVersion (MSBuild in Proj will do this) | |
id: gitversion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
useConfigFile: true | |
configFilePath: ./GitVersion.yml | |
- name: Build | |
run: dotnet build --no-restore | |
working-directory: uSync.Migrations | |
- name: Test | |
run: dotnet test | |
working-directory: uSync.Migrations.Tests | |
- name: Dotnet Pack (Core) | |
run: dotnet pack --output ../build.out/ /p:version=${{ steps.gitversion.outputs.fullSemVer }} | |
working-directory: uSync.Migrations.Core | |
- name: Dotnet Pack (Client) | |
run: dotnet pack --output ../build.out/ /p:version=${{ steps.gitversion.outputs.fullSemVer }} | |
working-directory: uSync.Migrations.Client | |
- name: Dotnet Pack (Migrators) | |
run: dotnet pack --output ../build.out/ /p:version=${{ steps.gitversion.outputs.fullSemVer }} | |
working-directory: uSync.Migrations.Migrators | |
- name: Dotnet Pack (Main package) | |
run: dotnet pack --output ../build.out/ /p:version=${{ steps.gitversion.outputs.fullSemVer }} | |
working-directory: uSync.Migrations | |
- name: Upload nuget file as build artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Nuget Build Output | |
path: ./build.out/ | |
- name: Push to GitHub Nuget Repo | |
if: ${{ github.event_name != 'pull_request' }} | |
run: dotnet nuget push ./build.out/*.nupkg --skip-duplicate --source https://nuget.pkg.github.com/jumoo/index.json --api-key ${{ github.token }} |