-
-
Notifications
You must be signed in to change notification settings - Fork 40
119 lines (106 loc) · 3.42 KB
/
release.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: release
# Release action which will fire when a new release is published.
on:
# release:
# types: [created, edited]
workflow_dispatch:
inputs:
tag_name:
description: "Release tag name e.g. '1.0.1'"
required: true
env:
VERSION_NUMBER: ${{ github.event.inputs.tag_name }}
BUILD_NUMBER: ${{ github.event.inputs.tag_name }}.${{ github.run_number }}
DOTNET_VERSION: 7.0.x
SOLUTION_PATH: ./src/AzureEventGridSimulator.sln
PROJECT_PATH: ./src/AzureEventGridSimulator/AzureEventGridSimulator.csproj
CONFIGURATION: Release
ARITFACT_PATH: ./dist
jobs:
test-release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
include:
- os: windows-latest
runtime: win-x64
- os: ubuntu-latest
runtime: linux-x64
- os: macos-latest
runtime: osx-x64
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
steps:
- name: log github context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: setup dotnet core
uses: actions/[email protected]
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: get the code
uses: actions/[email protected]
- name: clean
run: dotnet clean
--configuration ${{ env.CONFIGURATION }}
--nologo
${{ env.SOLUTION_PATH }}
- name: restore
run: dotnet restore
--runtime ${{ matrix.runtime }}
--nologo
${{ env.SOLUTION_PATH }}
- name: build
run: dotnet build
--configuration ${{ env.CONFIGURATION }}
--runtime ${{ matrix.runtime }}
--self-contained false
--no-incremental
--nologo
/p:WarningLevel=4
/p:TreatWarningsAsErrors=true
/p:NoWarn=""
/p:WarningsAsErrors=""
${{ env.SOLUTION_PATH }}
- name: test
run: dotnet test
--configuration ${{ env.CONFIGURATION }}
--runtime ${{ matrix.runtime }}
--no-restore
--no-build
--nologo
--filter "Category=unit|Category=integration"
${{ env.SOLUTION_PATH }}
- name: publish
run: dotnet publish
--configuration ${{ env.CONFIGURATION }}
--runtime ${{ matrix.runtime }}
--no-restore
--nologo
--self-contained true
/p:BuildNumber=${{ env.BUILD_NUMBER }}
/p:Version=${{ env.BUILD_NUMBER }}
/p:PublishReadyToRun=false
/p:IncludeNativeLibrariesForSelfExtract=true
/p:PublishSingleFile=true
/p:PublishTrimmed=true
/p:TrimUnusedDependencies=true
--output ${{ env.ARITFACT_PATH }}
${{ env.PROJECT_PATH }}
- name: zip artifacts
uses: papeloto/action-zip@v1
with:
files: ${{ env.ARITFACT_PATH }}/
recursive: true
dest: AzureEventGridSimulator-${{ matrix.runtime }}-${{ env.VERSION_NUMBER }}.zip
- name: release artifacts
uses: softprops/action-gh-release@v2
with:
name: ${{ env.VERSION_NUMBER }}
tag_name: ${{ env.VERSION_NUMBER }}
files: AzureEventGridSimulator-${{ matrix.runtime }}-${{ env.VERSION_NUMBER }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}