Skip to content

Commit ca1c88a

Browse files
authored
Update release.yml
1 parent c6ee2f6 commit ca1c88a

1 file changed

Lines changed: 28 additions & 33 deletions

File tree

.github/workflows/release.yml

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,37 @@
1-
# This is a basic workflow to help you get started with Actions
2-
31
name: Release to Nuget
42

53
# Controls when the workflow will run
6-
on:
4+
on:
75
push:
8-
tags:
9-
- "v[0-9]+.[0-9]+.[0-9]+"
10-
6+
tags:
7+
- "v[0-9]+.[0-9]+.[0-9]+"
8+
branches:
9+
- "main"
10+
- "release/*"
11+
- "feature/*"
12+
- "v15/*"
1113
jobs:
1214
build:
1315
runs-on: ubuntu-latest
1416
timeout-minutes: 15
15-
strategy:
16-
matrix:
17-
dotnet-version: [ '9.0.x']
18-
1917
steps:
20-
- name: Checkout code
21-
uses: actions/checkout@v4
22-
- name: Setup dotnet
23-
uses: actions/setup-dotnet@v4
24-
with:
25-
dotnet-version: |
26-
9.0.x
27-
- name: Verify commit exists in origin/main
28-
run: |
29-
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
30-
git branch --remote --contains | grep origin/main
31-
32-
- name: Set VERSION variable from tag
33-
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
34-
- name: Build
35-
run: dotnet build --configuration Release /p:Version=${VERSION}
36-
- name: Pack
37-
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output .
38-
- name: Push
39-
40-
run: dotnet nuget push UmbracoDayOfWeek.${VERSION}.nupkg --api-key ${NUGET_API_KEY} --source https://api.nuget.org/v3/index.json
41-
env:
42-
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
- name: Verify commit exists in origin/main
21+
run: |
22+
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
23+
git branch --remote --contains | grep origin/main
24+
- name: Setup .NET
25+
uses: actions/setup-dotnet@v3
26+
with:
27+
dotnet-version: 9.0.102
28+
- name: Set VERSION variable from tag
29+
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
30+
- name: Build
31+
run: dotnet build --configuration Release /p:Version=${VERSION}
32+
- name: Pack
33+
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output .
34+
- name: Push
35+
run: dotnet nuget push UmbracoDayOfWeek.${VERSION}.nupkg --api-key ${NUGET_API_KEY} --source https://api.nuget.org/v3/index.json
36+
env:
37+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

0 commit comments

Comments
 (0)