forked from open-telemetry/opentelemetry-dotnet-contrib
66 lines (53 loc) · 2.5 KB
/
package-Instrumentation.EntityFrameworkCore.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
name: Pack OpenTelemetry.Instrumentation.EntityFrameworkCore
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
push:
tags:
- 'Instrumentation.EntityFrameworkCore-*' # trigger when we create a tag with prefix "Instrumentation.EntityFrameworkCore-"
jobs:
build-test-pack:
runs-on: ${{ matrix.os }}
permissions:
contents: write
env:
PROJECT: OpenTelemetry.Instrumentation.EntityFrameworkCore
strategy:
matrix:
os: [windows-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetching all
- name: Setup dotnet
uses: actions/setup-dotnet@v4
- name: Install dependencies
run: dotnet restore src/${{env.PROJECT}}
- name: dotnet build ${{env.PROJECT}}
run: dotnet build src/${{env.PROJECT}} --configuration Release --no-restore -p:Deterministic=true
- name: dotnet test ${{env.PROJECT}}
run: dotnet test test/${{env.PROJECT}}.Tests
- name: dotnet pack ${{env.PROJECT}}
run: dotnet pack src/${{env.PROJECT}} --configuration Release --no-build
- name: Publish Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{env.PROJECT}}-packages
path: '**/${{env.PROJECT}}/bin/**/*.*nupkg'
- name: Publish Nuget
run: |
nuget push **/${{env.PROJECT}}/bin/**/*.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_TOKEN }} -SymbolApiKey ${{ secrets.NUGET_TOKEN }}
- name: Create GitHub Prerelease
if: ${{ (contains(github.ref_name, '-alpha.') || contains(github.ref_name, '-beta.') || contains(github.ref_name, '-rc.')) }}
run: gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --verify-tag --notes "See [CHANGELOG](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/${{ github.ref_name }}/src/${{env.PROJECT}}/CHANGELOG.md) for details." --prerelease
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
if: ${{ !(contains(github.ref_name, '-alpha.') || contains(github.ref_name, '-beta.') || contains(github.ref_name, '-rc.')) }}
run: gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --verify-tag --notes "See [CHANGELOG](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/${{ github.ref_name }}/src/${{env.PROJECT}}/CHANGELOG.md) for details." --latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}