35 lines (35 loc) · 2.28 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
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- 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 from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Test
run: dotnet test FusionCache.Plugins.Metrics.DotnetCore.sln --configuration Release /p:Version=${VERSION} --verbosity detailed
- name: Pack
run: |
dotnet pack -v normal -c Release --no-build --include-source -p:PackageVersion=${VERSION} src/FusionCache.Plugins.Metrics.Core/FusionCache.Plugins.Metrics.Core.csproj --output .
dotnet pack -v normal -c Release --no-build --include-source -p:PackageVersion=${VERSION} src/FusionCache.Plugins.Metrics.EventCounters/FusionCache.Plugins.Metrics.EventCounters.csproj --output .
dotnet pack -v normal -c Release --no-build --include-source -p:PackageVersion=${VERSION} src/FusionCache.Plugins.Metrics.AppMetrics/FusionCache.Plugins.Metrics.AppMetrics.csproj --output .
dotnet pack -v normal -c Release --no-build --include-source -p:PackageVersion=${VERSION} src/FusionCache.Plugins.Metrics.OpenTelemetry/FusionCache.Plugins.Metrics.OpenTelemetry.csproj --output .
- name: Push
run: |
dotnet nuget push JoeShook.ZiggyCreatures.FusionCache.Metrics.Core.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
dotnet nuget push JoeShook.ZiggyCreatures.FusionCache.Metrics.EventCounters.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
dotnet nuget push JoeShook.ZiggyCreatures.FusionCache.Metrics.AppMetrics.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
dotnet nuget push JoeShook.ZiggyCreatures.FusionCache.Metrics.OpenTelemetry.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}