forked from xoofx/UnityNuGet
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 1.31 KB
/
ci.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
---
name: ci
env:
PROJECT_NAME: UnityNuGet
on:
push:
paths-ignore:
- doc/**
- img/**
- changelog.md
- readme.md
pull_request:
paths-ignore:
- doc/**
- img/**
- changelog.md
- readme.md
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Build & test (Release)
run: dotnet test src -c Release --logger "console;verbosity=normal"
- name: Should Deploy?
if: github.event_name == 'push'
run: |
if ( "${{github.ref}}" -match "^refs/tags/[0-9]+\.[0-9]+\.[0-9]+" ) {
echo "UNITYNUGET_DEPLOY=1" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
}
- name: Publish (Release)
if: env.UNITYNUGET_DEPLOY == 1
run: dotnet publish src/UnityNuGet.Server/UnityNuGet.Server.csproj -c Release -o build/${{env.PROJECT_NAME}}
- name: Azure Deploy
if: env.UNITYNUGET_DEPLOY == 1
uses: azure/webapps-deploy@v3
with:
app-name: unitynuget-registry
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: build/${{env.PROJECT_NAME}}