-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (54 loc) · 1.5 KB
/
build.yml
File metadata and controls
57 lines (54 loc) · 1.5 KB
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
name: Build, Test, Package
on:
push:
branches: [ master ]
paths:
- 'src/**.csproj'
- '.github/workflows/build.yml'
pull_request:
branches: [ master ]
jobs:
ubuntu-test:
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
steps:
- uses: actions/checkout@v2
- name: Caching
uses: actions/cache@v2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/*.csproj') }} #hash of project files
restore-keys: |
${{ runner.os }}-
- name: Setup .NET Sdk
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
9.x
- name: Test .NET 9
run: dotnet test -v normal -f net9.0 --logger "console;verbosity=detailed" --nologo /nologo
upload-packages:
needs: [ubuntu-test]
if: success()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Caching
uses: actions/cache@v2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/*.csproj') }} #hash of project files
restore-keys: |
${{ runner.os }}-
- name: Setup .NET Sdk
uses: actions/setup-dotnet@v1
with:
dotnet-version: '9.x'
- name: Publish Nuget Package
uses: alirezanet/publish-nuget@v3.0.4
with:
PROJECT_FILE_PATH: src/ScriptSourceGenerator/ScriptSourceGenerator.csproj
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
TAG_FORMAT: v*