(feat) Adding scoring to route paths so wildcards are considered last #117
Workflow file for this run
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: Main Release | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- '**' | |
env: | |
DOCKER_HUB_USERNAME: natenho | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, 'skip-ci')" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v1 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '6.0.x' | |
- name: Setup GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: '5.x' | |
- name: Determine version | |
id: gitversion | |
uses: gittools/actions/gitversion/[email protected] | |
- name: Restore dependencies | |
run: dotnet restore --verbosity normal | |
- name: Build | |
run: dotnet build --configuration Release --verbosity normal src/Mockaco/Mockaco.csproj | |
- name: Test | |
run: dotnet test --configuration Release --verbosity normal test/Mockaco.AspNetCore.Tests/Mockaco.AspNetCore.Tests.csproj | |
- name: Bump version and push tag | |
if: "github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, 'skip-release')" | |
id: tag_version | |
uses: mathieudutour/[email protected] | |
with: | |
custom_tag: ${{ steps.gitversion.outputs.semVer }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create a GitHub release | |
if: "github.ref == 'refs/heads/master'" | |
id: github_release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: v${{ steps.gitversion.outputs.semVer }} | |
name: v${{ steps.gitversion.outputs.semVer }} | |
body: ${{ steps.tag_version.outputs.changelog }} | |
- name: Create nupkg | |
run: dotnet pack --configuration Nuget --output ./nupkg | |
- name: Publish nupkg | |
if: "github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, 'skip-nuget')" | |
run: dotnet nuget push **/*.nupkg --api-key ${{secrets.NUGET_AUTH_TOKEN}} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
- name: Cache Docker layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
if: "github.ref == 'refs/heads/master'" | |
with: | |
username: ${{ env.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Setup Docker Build | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Docker Build | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./ | |
file: ./src/Mockaco/Docker/Dockerfile | |
push: ${{ github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, 'skip-docker') }} | |
tags: ${{ env.DOCKER_HUB_USERNAME }}/mockaco:latest,${{ env.DOCKER_HUB_USERNAME }}/mockaco:${{ steps.gitversion.outputs.semVer }} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
platforms: linux/amd64,linux/arm64 | |
- name: Docker Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |