Skip to content

Update whitelist type to list and add regex to remove whitespace from… #49

Update whitelist type to list and add regex to remove whitespace from…

Update whitelist type to list and add regex to remove whitespace from… #49

name: Hackney.Core.Authorization-publish
on:
push:
branches:
- release
- feature/**
paths:
- "Hackney.Core/Hackney.Core.Authorization/**"
- "Hackney.Core.Tests/Hackney.Core.Tests.Authorization/**"
- ".github/workflows/Hackney.Core.Authorization.yml"
jobs:
calculate-version:
name: Calculate Version
runs-on: ubuntu-latest
env:
LBHPACKAGESTOKEN: ${{secrets.LBHPACKAGESTOKEN }}
outputs:
version: ${{ steps.gitversion.outputs.nuGetVersionV2 }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: '5.x'
- name: Determine package version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.7
with:
useConfigFile: true
- name: Display package version
run: |
echo "Version: $GITVERSION_NUGETVERSIONV2"
check-code-formatting:
name: Check code formatting
runs-on: ubuntu-latest
needs: calculate-version
env:
LBHPACKAGESTOKEN: ${{secrets.LBHPACKAGESTOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dotnet format
run: |
cd Hackney.Core
dotnet tool install dotnet-format --tool-path ./dotnet-format-local/
- name: Run formatter check
run: |
cd Hackney.Core
./dotnet-format-local/dotnet-format --check Hackney.Core.Authorization
build-and-test:
name: Build & Test
runs-on: ubuntu-latest
needs: calculate-version
env:
LBHPACKAGESTOKEN: ${{secrets.LBHPACKAGESTOKEN }}
outputs:
version: ${{ needs.calculate-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build
run: docker-compose build hackney-core-authorization-test
- name: Run tests
run: docker-compose run hackney-core-authorization-test
publish-authorization-package:
name: Publish Authorization Package
runs-on: ubuntu-latest
needs:
- check-code-formatting
- build-and-test
env:
VERSION: ${{ needs.build-and-test.outputs.version }}
LBHPACKAGESTOKEN: ${{secrets.LBHPACKAGESTOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build the Package
run: |
cd Hackney.Core
dotnet pack Hackney.Core.Authorization -p:PackageVersion=$VERSION --configuration Release
- name: Publish the Package
run: |
cd Hackney.Core/Hackney.Core.Authorization/bin/Release
dotnet nuget push Hackney.Core.Authorization.*.nupkg -s https://nuget.pkg.github.com/LBHackney-IT/index.json --api-key ${{secrets.NUGET_KEY }}