-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (63 loc) · 2.1 KB
/
dotnet.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
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET Web Site and API
concurrency:
group: main
cancel-in-progress: true
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
Build:
permissions: write-all
runs-on: ubuntu-latest
environment: production
strategy:
matrix:
dotnet-version: ['8.0.x']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
- name: Upload dotnet test results
uses: actions/upload-artifact@v4
with:
name: dotnet-results-${{ matrix.dotnet-version }}
path: TestResults-${{ matrix.dotnet-version }}
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
- name: Publish Release build
run: dotnet publish -c Release -o ../dotnet-webapp -r linux-x64 --self-contained true /p:UseAppHost=true
- name: Prepare temporary folder for archive
run: mkdir ./deploy_net8_linux-x64
- name: Copy built artefacts
run: cp -r ./Taggloo4.Web/bin/Release/net8.0/linux-x64/* deploy_net8_linux-x64
- name: Compress
uses: TonyBogdanov/[email protected]
with:
args: zip -r ./deploy_net8_linux-x64.zip ./deploy_net8_linux-x64 -i *
- name: Create GitHub Release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: "Latest Build"
files: |
./deploy_net8_linux-x64.zip
README.md
CHANGELOG.md