-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (81 loc) · 2.54 KB
/
Hackney.Core.Logging.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Hackney.Core.Logging-publish
on:
push:
branches:
- release
- feature/**
paths:
- "Hackney.Core/Hackney.Core.Logging/**"
- "Hackney.Core.Tests/Hackney.Core.Tests.Logging/**"
- ".github/workflows/Hackney.Core.Logging.yml"
jobs:
calculate-version:
name: Calculate Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.gitversion.outputs.nuGetVersionV2 }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Determine package version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
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
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.Logging
build-and-test:
name: Build & Test
runs-on: ubuntu-latest
needs: calculate-version
env:
LBHPACKAGESTOKEN: ${{secrets.GITHUB_TOKEN }}
outputs:
version: ${{ needs.calculate-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build
run: docker compose build hackney-core-logging-test
- name: Run tests
run: docker compose run hackney-core-logging-test
publish-package:
name: Publish Package
runs-on: ubuntu-latest
needs: build-and-test
env:
VERSION: ${{ needs.build-and-test.outputs.version }}
LBHPACKAGESTOKEN: ${{secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build the Package
run: |
cd Hackney.Core
dotnet pack Hackney.Core.Logging -p:PackageVersion=$VERSION --configuration Release
- name: Publish the Package
run: |
cd Hackney.Core/Hackney.Core.Logging/bin/Release
dotnet nuget push Hackney.Core.Logging.*.nupkg -s https://nuget.pkg.github.com/LBHackney-IT/index.json --api-key ${{secrets.GITHUB_TOKEN }}