This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (55 loc) · 1.6 KB
/
deploy.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
name: Deploy
on:
workflow_dispatch:
inputs:
version:
description: "Version number"
default: "0.0.0"
required: true
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Protoc
uses: zchee/setup-protoc@v1
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.x'
- name: Test
run: |
./compile-protobuf.sh
dotnet test --verbosity=normal
build:
name: Deploy
needs: test
runs-on: ubuntu-latest
environment: Deployment
steps:
- uses: actions/checkout@v4
- name: Install Protoc
uses: zchee/setup-protoc@v1
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
- name: Build
run: |
./compile-protobuf.sh
dotnet build -c Release
- name: Pack
run: dotnet pack Sources/SMTSP/SMTSP.csproj -c Release -p:PackageVersion='${{ github.event.inputs.version }}' --output packages
- name: Publish Package on NuGet
run: nuget push **\*.nupkg -NoSymbols -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{ secrets.NUGET_API_KEY }}
- name: Create Release strings
id: release_strings
run: |
echo "RELEASE_TAG=${{ github.event.inputs.version }}" >> $GITHUB_ENV
echo "RELEASE_NAME=Version ${{ github.event.inputs.version }}" >> $GITHUB_ENV
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.RELEASE_TAG }}
name: ${{ env.RELEASE_NAME }}