-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (68 loc) · 2.41 KB
/
publish.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
67
68
69
70
71
name: Publish Release
on:
release:
types:
- "published"
push:
paths:
- ".github/workflows/publish.yml"
- "src/Bundles/Bundles.csproj"
- "tests/Bundles.Tests/Bundles.Tests.csproj"
- "Directory.Build.props"
- "Directory.Packages.props"
env:
DOTNET_NOLOGO: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
jobs:
publish_release:
name: Publish Release
runs-on: ubuntu-latest
if: "!contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[ci-skip]') && contains(github.event.release.target_commitish, 'master') && github.event_name == 'release'"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8
- name: Publish NuGet packages
run: |
mkdir build
dotnet pack -c Release -o build
dotnet nuget push "build/*" -k ${{ secrets.NUGET_ORG_API_KEY }} -s https://api.nuget.org/v3/index.json
- name: Upload NuGet packages to GitHub Actions
uses: actions/upload-artifact@v3
with:
name: Bundles Release ${{ github.event.release.name }} NuGet Packages.zip
path: build/*
- name: Upload NuGet Packages To GitHub Release
uses: "ncipollo/release-action@v1"
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "build/*"
token: ${{ secrets.GITHUB_TOKEN }}
omitNameDuringUpdate: true # We don't want to update the name of the release.
omitBodyDuringUpdate: true # We don't want to update the body of the release.
test_release:
name: Test Release
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci-skip]') && github.ref_name == 'master' && github.event_name == 'push'"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8
- name: Publish NuGet packages
run: |
mkdir build
dotnet pack -c Release -o build
- name: Upload NuGet packages to GitHub Actions
uses: actions/upload-artifact@v3
with:
name: Bundles Release ${{ github.event.release.name }} NuGet Packages.zip
path: build/*