Skip to content

Commit 32700ea

Browse files
committed
ci: narrow the publish workflow to tags and dispatch
It also triggered on every push and PR touching src/Base58Encoding/**, where it only restored and built: Pack and Upload are gated on a version being set, so those runs never produced anything. tests.yml and aot-tests.yml already build the same solution across more platforms. The Test step stays. tests.yml does not run on a tag -- a branches: filter never matches refs/tags/* -- so it is the only thing that runs the suite against a tag cut from anywhere other than an already-tested master commit.
1 parent 29cb0dc commit 32700ea

1 file changed

Lines changed: 7 additions & 20 deletions

File tree

.github/workflows/publish-nuget.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,12 @@
11
name: Build and Publish to NuGet
22

3+
# Release-only: tags and manual dispatch. Ordinary pushes and PRs are covered by tests.yml and
4+
# aot-tests.yml, which build the same solution across more platforms -- this one used to duplicate
5+
# that on every library change while never packing, since Pack is gated on a version being set.
36
on:
47
push:
58
tags:
69
- 'v*.*.*'
7-
branches: [ master, main ]
8-
paths:
9-
- 'src/Base58Encoding/**'
10-
- 'src/Directory.Build.props'
11-
- 'src/Directory.Packages.props'
12-
- 'src/NuGet.Config'
13-
- 'src/PACKAGE.md'
14-
- 'global.json'
15-
pull_request:
16-
branches: [ master, main ]
17-
paths:
18-
- 'src/Base58Encoding/**'
19-
- 'src/Directory.Build.props'
20-
- 'src/Directory.Packages.props'
21-
- 'src/NuGet.Config'
22-
- 'src/PACKAGE.md'
23-
- 'global.json'
2410
workflow_dispatch:
2511
inputs:
2612
version:
@@ -59,9 +45,10 @@ jobs:
5945
- name: Build
6046
run: dotnet build src/Base58Encoding.slnx --configuration Release --no-restore
6147

62-
# Only on the publishing path -- tests.yml covers branches and PRs. It has to stay in this job
63-
# rather than lean on that workflow: the two run concurrently, so a red tests.yml would not stop
64-
# this one from packing, and a tag push does not trigger it at all (branch filters skip tags).
48+
# The release path's own gate. tests.yml never runs on a tag -- a branches: filter does not
49+
# match refs/tags/* -- so for a tag cut anywhere other than an already-tested master commit,
50+
# nothing else has run the suite against this ref. Skipped only for a dispatch with no version,
51+
# which builds without packing.
6552
- name: Test
6653
if: env.VERSION != ''
6754
run: dotnet test --project src/Base58Encoding.Tests/Base58Encoding.Tests.csproj --configuration Release --no-build --verbosity normal

0 commit comments

Comments
 (0)