-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (64 loc) · 2.96 KB
/
feature.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
name: "Dev CI/CD"
# Controls when the workflow will run
on:
workflow_dispatch:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [feature/*, release/*]
# environment vars
env:
configuration: Release
solution: EasyKeys.Shipping.sln
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
outputs:
Version: ${{ steps.gitversion.outputs.nuGetVersionV2 }}
CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# https://github.com/GitTools/actions
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: "5.x"
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0 # to fetch all history for all tags and branches
# https://github.com/GitTools/actions/blob/main/docs/examples/github/gitversion/execute/usage-examples.md
- name: Use GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
updateAssemblyInfo: false
updateAssemblyInfoFilename: false
- name: Display GitVersion outputs
run: |
echo "ShortSha: ${{ steps.gitversion.outputs.shortSha }}"
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}"
echo "VersionSourceSha: ${{ steps.gitversion.outputs.versionSourceSha }}"
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.commitsSinceVersionSource }}"
echo "CommitDate: ${{ steps.gitversion.outputs.commitDate }}"
- name: Install .net8.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: "8.0.x"
include-prerelease: true
- name: Clear Nuget Feeds
run: dotnet nuget locals --clear all
- name: Restore dependencies
run: dotnet restore ${{ env.solution }} -v quiet
- name: Build
run: dotnet build ${{ env.solution }} --configuration ${{ env.configuration }} --no-restore -p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }}
- name: Test
run: dotnet test ./test/**/*.UnitTest.csproj --no-build --verbosity normal
- name: Package
run: dotnet pack --no-build --configuration ${{ env.configuration }} --no-restore -p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }} -o packages
- name: Publish Nuget Packages
run: dotnet nuget push packages/*.nupkg --api-key ${{ secrets.FEEDZ_API_KEY }} --source https://f.feedz.io/easykeys/core/nuget/index.json --skip-duplicate --no-symbols