-
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (52 loc) · 2.63 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
name: .NET
on:
create:
tags: [ 'v*.*.*' ]
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: write
env:
CONFIGURATION: Release
DOTNET_VERSION: 7.0.x
jobs:
dotnet:
name: .NET
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Setup Quill
run: curl -sSfL https://raw.githubusercontent.com/anchore/quill/main/install.sh | sh -s -- -b /usr/local/bin
- name: Setup Release
if: github.event_name == 'create' && github.event.ref_type == 'tag'
run: echo "RELEASE_NAME=${GITHUB_REPOSITORY#*/} ${GITHUB_REF_NAME}" >> $GITHUB_ENV
- name: Restore
run: dotnet restore /p:PublishTrimmed=true
- name: Test
run: dotnet test --configuration "$CONFIGURATION" --no-restore --verbosity normal
- name: Publish linux-arm64
run: dotnet publish --configuration "$CONFIGURATION" --no-restore --runtime linux-arm64 --self-contained true /p:PublishSingleFile=true /p:PublishTrimmed=true /p:SuppressTrimAnalysisWarnings=true /p:TrimMode=partial
- name: Publish linux-x64
run: dotnet publish --configuration "$CONFIGURATION" --no-restore --runtime linux-x64 --self-contained true /p:PublishSingleFile=true /p:PublishTrimmed=true /p:SuppressTrimAnalysisWarnings=true /p:TrimMode=partial
- name: Publish osx-arm64
run: dotnet publish --configuration "$CONFIGURATION" --no-restore --runtime osx-arm64 --self-contained true /p:PublishSingleFile=true /p:PublishTrimmed=true /p:SuppressTrimAnalysisWarnings=true /p:TrimMode=partial
- name: Publish osx-x64
run: dotnet publish --configuration "$CONFIGURATION" --no-restore --runtime osx-x64 --self-contained true /p:PublishSingleFile=true /p:PublishTrimmed=true /p:SuppressTrimAnalysisWarnings=true /p:TrimMode=partial
- name: Publish win-arm64
run: dotnet publish --configuration "$CONFIGURATION" --no-restore --runtime win-arm64 --self-contained true /p:PublishSingleFile=true /p:PublishTrimmed=true /p:SuppressTrimAnalysisWarnings=true /p:TrimMode=partial
- name: Publish win-x64
run: dotnet publish --configuration "$CONFIGURATION" --no-restore --runtime win-x64 --self-contained true /p:PublishSingleFile=true /p:PublishTrimmed=true /p:SuppressTrimAnalysisWarnings=true /p:TrimMode=partial
- name: Release
if: github.event_name == 'create' && github.event.ref_type == 'tag'
uses: softprops/action-gh-release@v1
with:
files: ./dist/*
generate_release_notes: true
name: ${{ env.RELEASE_NAME }}