-
-
Notifications
You must be signed in to change notification settings - Fork 10
57 lines (45 loc) · 1.79 KB
/
release.yml
File metadata and controls
57 lines (45 loc) · 1.79 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: dotnet release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
env:
VERSION: 0.0.1
jobs:
build:
runs-on: ubuntu-latest
environment: nuget
steps:
- uses: actions/checkout@v4
- name: Verify commit exists in origin/main
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/main
- name: Set Version Variable
if: ${{ github.ref_type == 'tag' }}
env:
TAG: ${{ github.ref_name }}
run: echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup .NET 9.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Setup .NET 10.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Test net8.0
run: dotnet test PhenX.EntityFrameworkCore.BulkInsert.slnx --configuration Release --verbosity normal --framework net8.0
- name: Test net9.0
run: dotnet test PhenX.EntityFrameworkCore.BulkInsert.slnx --configuration Release --verbosity normal --framework net9.0
- name: Test net10.0
run: dotnet test PhenX.EntityFrameworkCore.BulkInsert.slnx --configuration Release --verbosity normal --framework net10.0
- name: Pack nuget packages
run: dotnet pack PhenX.EntityFrameworkCore.BulkInsert.slnx --configuration Release --no-build --output nupkgs /p:PackageVersion=$VERSION
- name: Upload nuget package
if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v')
run: dotnet nuget push nupkgs/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json