-
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (40 loc) · 1.46 KB
/
modules-cicd.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
name: CI-CD
on:
push:
tags:
- "*v*"
jobs:
deploy:
name: 'Build, Test & Deploy'
env:
BUILD_CONFIG: 'Release'
SOLUTION: './Modules.sln'
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: 'Get Version'
id: get_version
uses: battila7/get-version-action@v2
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.0.2
- name: Restore dependencies
run: nuget restore $env:SOLUTION
- name: Build
run: dotnet build $env:SOLUTION --configuration $env:BUILD_CONFIG --no-restore
- name: Run tests
run: dotnet test $env:SOLUTION /p:Configuration=$env:BUILD_CONFIG --no-restore --no-build --verbosity normal
- name: Pack Modules
shell: pwsh
run: '& .\dotnet-tools\PushArtifact.ps1 -Version ${{ steps.get_version.outputs.version-without-v }} -EnvFile .\.env'
- name: Publish
run: |
dotnet nuget push .\Nuget\Packages\${{ steps.get_version.outputs.version }}\*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}}
dotnet nuget push .\Nuget\Packages\${{ steps.get_version.outputs.version }}\*.nupkg --source 'https://nuget.pkg.github.com/joshika39/index.json' --api-key ${{secrets.GIT_API_KEY}}