Skip to content

Commit

Permalink
chore: update workflows (#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewTriesToCode authored Sep 30, 2021
1 parent aceff1d commit 89bf69c
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/linux-3.1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Linux (.NET Core 3.1)
on:
push:
branches: [main]
pull_request:

jobs:
os-tests:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/linux-5.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Linux (.NET 5.0)
on:
push:
branches: [main]
pull_request:

jobs:
os-tests:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/macos-3.1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: MacOS (.NET Core 3.1)
on:
push:
branches: [main]
pull_request:

jobs:
os-tests:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/macos-5.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: MacOS (.NET 5.0)
on:
push:
branches: [main]
pull_request:

jobs:
os-tests:
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/nuget-push-public.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: NuGet Push Public

on: [workflow_dispatch]

jobs:
build-test-prep-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Create the package
run: dotnet test -c Release || dotnet pack --no-build -c Release --output nupkgs
- name: Publish the package to NuGet.org
env:
NUGET_KEY: ${{secrets.NUGET_KEY}}
run: dotnet nuget push nupkgs/*.nupkg -k $NUGET_KEY -s https://api.nuget.org/v3/index.json --skip-duplicate
4 changes: 1 addition & 3 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Pull Request Checks

on:
pull_request:
types: [opened, reopened, synchronize]
on: [workflow_dispatch]

jobs:
os-tests:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release

on: [workflow_dispatch]

jobs:
build-test-prep-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: build and test
run: |
dotnet restore
dotnet build -c Release --no-restore
dotnet test -c Release --no-build
- name: setup semantic-release
run: |
npm install -D semantic-release
npm install -D @semantic-release/git
npm install -D @semantic-release/changelog
npm install -D @semantic-release/exec
- name: run semantic-release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: npx semantic-release
1 change: 1 addition & 0 deletions .github/workflows/windows-3.1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Windows (.NET Core 3.1)
on:
push:
branches: [main]
pull_request:

jobs:
os-tests:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/windows-5.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Windows (.NET 5.0)
on:
push:
branches: [main]
pull_request:

jobs:
os-tests:
Expand Down
16 changes: 16 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github",
"@semantic-release/changelog",
["@semantic-release/exec", {
"prepareCmd": "sed -E -i 's/<(Version|span class=\"_version\")>.*<\\/(Version|span)>/<\\1>${nextRelease.version}<\\/\\2>/' Directory.Build.props *.md docs/*.md"
}],
["@semantic-release/git", {
"assets": ["Directory.Build.props", "*.md", "docs"],
"message": "chore(release-prep): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}]
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ public static MultiTenantEntityTypeBuilder IsMultiTenant(this EntityTypeBuilder
private static void UpdateIdentityUserIndex(this EntityTypeBuilder builder)
{
builder.RemoveIndex("NormalizedUserName");
#if NET // Covers .NET 5.0 and later.
#if NET // Covers .NET 5.0 and later.
builder.HasIndex("NormalizedUserName", "TenantId").HasDatabaseName("UserNameIndex").IsUnique();
#elif NETSTANDARD2_1 // .NET Core 3.1
#elif NETSTANDARD2_1 // .NET Core 3.1
builder.HasIndex("NormalizedUserName", "TenantId").HasName("UserNameIndex").IsUnique();
#endif
#endif
}

private static void UpdateIdentityRoleIndex(this EntityTypeBuilder builder)
Expand Down

0 comments on commit 89bf69c

Please sign in to comment.