Skip to content

Commit 188d55b

Browse files
committed
chore(release): plugin-version discipline — non-IaC adaptation (workflow#758)
Mirrors workflow-plugin-digitalocean PR #165 with the non-IaC adaptation (this plugin uses sdk.Serve, not sdk.ServeIaCPlugin): - Delete .github/workflows/sync-plugin-version.yml (sync mechanism retired; goreleaser before-hook + binary ldflag carry release-tag truth) - plugin.json.version → "0.0.0" (sentinel; flat M.m.p parses through PluginManifest.ParseSemver without prerelease) - plugin.json.minEngineVersion → 0.61.0 (requires sdk.ResolveBuildVersion + sdk.WithBuildVersion ServeOption landed in workflow v0.61.0) - plugin.json: add "capabilities" block (moduleTypes/stepTypes/triggerTypes) required by wfctl plugin validate-contract Check 2 - cmd/workflow-plugin-github/main.go: add sdk.WithBuildVersion ServeOption with sdk.ResolveBuildVersion(internal.Version); binary's runtime version surfaces via GetManifest RPC even when committed plugin.json shows the sentinel. Non-IaC variant: WithBuildVersion is a ServeOption to sdk.Serve, not a field on IaCServeOptions. - release.yml: pre-build wfctl plugin validate-contract --for-publish + post-build --release-dir verification; setup-wfctl pinned to v0.61.0 - Bump workflow pin v0.53.1 → v0.61.0 cmd/github-runner-provider/main.go untouched: standalone HTTP server, not an sdk-served plugin binary; goreleaser ldflag targets only internal.Version which is shared between both binaries via the same package. Note: internal.Version = "dev" already existed in internal/plugin.go (line 11); no Version var addition needed. Rollback: revert PR; restores prior sync mechanism + workflow pin.
1 parent 1a81c2b commit 188d55b

6 files changed

Lines changed: 161 additions & 267 deletions

File tree

.github/workflows/release.yml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,53 @@
11
name: Release
2-
32
on:
43
push:
54
tags:
6-
- "v*"
7-
5+
- 'v*'
86
permissions:
97
contents: write
10-
8+
id-token: write
119
jobs:
12-
goreleaser:
10+
release:
1311
runs-on: ubuntu-latest
1412
steps:
15-
- uses: actions/checkout@v6
13+
- uses: actions/checkout@v4
1614
with:
1715
fetch-depth: 0
18-
19-
- uses: actions/setup-go@v6
16+
- uses: actions/setup-go@v5
2017
with:
2118
go-version-file: go.mod
22-
23-
- name: Run GoReleaser
24-
uses: goreleaser/goreleaser-action@v7
19+
- uses: GoCodeAlone/setup-wfctl@v1
20+
with:
21+
version: v0.61.0
22+
- name: Validate plugin contract for publish (pre-build)
23+
run: wfctl plugin validate-contract --for-publish --tag "${{ github.ref_name }}" .
24+
- uses: goreleaser/goreleaser-action@v7
2525
with:
2626
distribution: goreleaser
27-
version: "~> v2"
27+
version: '~> v2'
2828
args: release --clean
2929
env:
3030
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3131
GOPRIVATE: github.com/GoCodeAlone/*
3232
GONOSUMCHECK: github.com/GoCodeAlone/*
33-
- name: Publish GitHub release
34-
if: ${{ success() }}
33+
- name: Verify shipped plugin.json carries tag (post-build)
34+
run: |
35+
if [ -f .release/plugin.json ]; then
36+
wfctl plugin validate-contract --for-publish --tag "${{ github.ref_name }}" --release-dir .release .
37+
else
38+
wfctl plugin validate-contract --for-publish --tag "${{ github.ref_name }}" --release-dir . .
39+
fi
40+
- name: Publish release (was draft during asset upload)
3541
env:
3642
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37-
run: gh release edit "${{ github.ref_name }}" --draft=false --repo "${{ github.repository }}"
43+
run: gh release edit ${{ github.ref_name }} --draft=false --repo ${{ github.repository }}
3844

3945
notify-workflow-registry:
4046
name: Notify workflow-registry
4147
runs-on: ubuntu-latest
4248
permissions:
4349
contents: read
44-
needs: goreleaser
50+
needs: release
4551
if: >-
4652
!github.event.deleted
4753
&& !contains(github.ref_name, '-')

.github/workflows/sync-plugin-version.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

cmd/workflow-plugin-github/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ import (
1010
)
1111

1212
func main() {
13-
sdk.Serve(internal.NewGitHubPlugin())
13+
sdk.Serve(internal.NewGitHubPlugin(),
14+
sdk.WithBuildVersion(sdk.ResolveBuildVersion(internal.Version)),
15+
)
1416
}

go.mod

Lines changed: 25 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,14 @@ module github.com/GoCodeAlone/workflow-plugin-github
33
go 1.26.0
44

55
require (
6-
github.com/GoCodeAlone/workflow v0.53.1
6+
github.com/GoCodeAlone/workflow v0.61.0
77
github.com/golang-jwt/jwt/v5 v5.3.1
88
github.com/google/go-github/v69 v69.2.0
9-
golang.org/x/crypto v0.50.0
10-
google.golang.org/protobuf v1.36.11
9+
golang.org/x/crypto v0.51.0
10+
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af
1111
)
1212

1313
require (
14-
cel.dev/expr v0.25.1 // indirect
15-
cloud.google.com/go v0.123.0 // indirect
16-
cloud.google.com/go/auth v0.19.0 // indirect
17-
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
18-
cloud.google.com/go/compute/metadata v0.9.0 // indirect
19-
cloud.google.com/go/iam v1.5.3 // indirect
20-
cloud.google.com/go/monitoring v1.24.3 // indirect
21-
cloud.google.com/go/storage v1.61.3 // indirect
2214
github.com/BurntSushi/toml v1.6.0 // indirect
2315
github.com/DataDog/datadog-go/v5 v5.8.3 // indirect
2416
github.com/GoCodeAlone/go-plugin v1.7.0 // indirect
@@ -29,9 +21,6 @@ require (
2921
github.com/GoCodeAlone/modular/modules/jsonschema v1.15.0 // indirect
3022
github.com/GoCodeAlone/modular/modules/reverseproxy/v2 v2.8.0 // indirect
3123
github.com/GoCodeAlone/yaegi v0.17.2 // indirect
32-
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.32.0 // indirect
33-
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.55.0 // indirect
34-
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.55.0 // indirect
3524
github.com/IBM/sarama v1.47.0 // indirect
3625
github.com/Microsoft/go-winio v0.6.2 // indirect
3726
github.com/RoaringBitmap/roaring v1.9.4 // indirect
@@ -47,44 +36,41 @@ require (
4736
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.22 // indirect
4837
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.23 // indirect
4938
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.8 // indirect
50-
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.12 // indirect
5139
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.22 // indirect
52-
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.20 // indirect
5340
github.com/aws/aws-sdk-go-v2/service/kinesis v1.43.4 // indirect
54-
github.com/aws/aws-sdk-go-v2/service/s3 v1.97.2 // indirect
5541
github.com/aws/aws-sdk-go-v2/service/signin v1.0.10 // indirect
5642
github.com/aws/aws-sdk-go-v2/service/sso v1.30.16 // indirect
5743
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.20 // indirect
5844
github.com/aws/aws-sdk-go-v2/service/sts v1.42.0 // indirect
5945
github.com/aws/smithy-go v1.25.0 // indirect
6046
github.com/beorn7/perks v1.0.1 // indirect
6147
github.com/bits-and-blooms/bitset v1.24.4 // indirect
48+
github.com/bytedance/gopkg v0.1.4 // indirect
49+
github.com/bytedance/sonic v1.15.1 // indirect
50+
github.com/bytedance/sonic/loader v0.5.1 // indirect
6251
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
6352
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
6453
github.com/cespare/xxhash/v2 v2.3.0 // indirect
6554
github.com/cloudevents/sdk-go/v2 v2.16.2 // indirect
66-
github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 // indirect
55+
github.com/cloudwego/base64x v0.1.7 // indirect
6756
github.com/containerd/errdefs v1.0.0 // indirect
6857
github.com/containerd/errdefs/pkg v0.3.0 // indirect
6958
github.com/danieljoos/wincred v1.2.3 // indirect
7059
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
7160
github.com/deckarep/golang-set/v2 v2.9.0 // indirect
72-
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
7361
github.com/distribution/reference v0.6.0 // indirect
7462
github.com/docker/docker v28.5.2+incompatible // indirect
7563
github.com/docker/go-connections v0.7.0 // indirect
7664
github.com/docker/go-units v0.5.0 // indirect
7765
github.com/dustin/go-humanize v1.0.1 // indirect
7866
github.com/eapache/go-resiliency v1.7.0 // indirect
7967
github.com/eapache/queue v1.1.0 // indirect
80-
github.com/envoyproxy/go-control-plane/envoy v1.37.0 // indirect
81-
github.com/envoyproxy/protoc-gen-validate v1.3.3 // indirect
8268
github.com/expr-lang/expr v1.17.8 // indirect
8369
github.com/fatih/color v1.19.0 // indirect
8470
github.com/felixge/httpsnoop v1.0.4 // indirect
8571
github.com/flowchartsman/retry v1.2.0 // indirect
8672
github.com/fsnotify/fsnotify v1.9.0 // indirect
87-
github.com/fxamacker/cbor/v2 v2.9.1 // indirect
73+
github.com/fxamacker/cbor/v2 v2.9.2 // indirect
8874
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
8975
github.com/go-logr/logr v1.4.3 // indirect
9076
github.com/go-logr/stdr v1.2.2 // indirect
@@ -93,10 +79,7 @@ require (
9379
github.com/golobby/cast v1.3.3 // indirect
9480
github.com/google/btree v1.1.3 // indirect
9581
github.com/google/go-querystring v1.1.0 // indirect
96-
github.com/google/s2a-go v0.1.9 // indirect
9782
github.com/google/uuid v1.6.0 // indirect
98-
github.com/googleapis/enterprise-certificate-proxy v0.3.14 // indirect
99-
github.com/googleapis/gax-go/v2 v2.19.0 // indirect
10083
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
10184
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect
10285
github.com/hashicorp/errwrap v1.1.0 // indirect
@@ -130,10 +113,10 @@ require (
130113
github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect
131114
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
132115
github.com/json-iterator/go v1.1.13-0.20220915233716-71ac16282d12 // indirect
133-
github.com/klauspost/compress v1.18.5 // indirect
116+
github.com/klauspost/compress v1.18.6 // indirect
134117
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
135118
github.com/mattn/go-colorable v0.1.14 // indirect
136-
github.com/mattn/go-isatty v0.0.21 // indirect
119+
github.com/mattn/go-isatty v0.0.22 // indirect
137120
github.com/miekg/dns v1.1.72 // indirect
138121
github.com/mitchellh/go-homedir v1.1.0 // indirect
139122
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
@@ -143,7 +126,7 @@ require (
143126
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
144127
github.com/mschoch/smat v0.2.0 // indirect
145128
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
146-
github.com/nats-io/nats.go v1.51.0 // indirect
129+
github.com/nats-io/nats.go v1.52.0 // indirect
147130
github.com/nats-io/nkeys v0.4.15 // indirect
148131
github.com/nats-io/nuid v1.0.1 // indirect
149132
github.com/ncruces/go-strftime v1.0.0 // indirect
@@ -152,25 +135,24 @@ require (
152135
github.com/opencontainers/image-spec v1.1.1 // indirect
153136
github.com/pierrec/lz4/v4 v4.1.26 // indirect
154137
github.com/pkg/errors v0.9.1 // indirect
155-
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
156138
github.com/prometheus/client_golang v1.23.2 // indirect
157139
github.com/prometheus/client_model v0.6.2 // indirect
158140
github.com/prometheus/common v0.67.5 // indirect
159141
github.com/prometheus/procfs v0.20.1 // indirect
160142
github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 // indirect
161-
github.com/redis/go-redis/v9 v9.18.0 // indirect
143+
github.com/redis/go-redis/v9 v9.19.0 // indirect
162144
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
163145
github.com/reugn/go-quartz v0.15.2 // indirect
164146
github.com/robfig/cron/v3 v3.0.1 // indirect
165147
github.com/ryanuber/go-glob v1.0.0 // indirect
166148
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
167149
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
168-
github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect
169150
github.com/tidwall/btree v1.8.1 // indirect
170151
github.com/tidwall/match v1.2.0 // indirect
171152
github.com/tidwall/redcon v1.6.2 // indirect
172-
github.com/tochemey/goakt/v4 v4.2.2 // indirect
153+
github.com/tochemey/goakt/v4 v4.2.4 // indirect
173154
github.com/tochemey/olric v0.3.9 // indirect
155+
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
174156
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
175157
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
176158
github.com/x448/float16 v0.8.4 // indirect
@@ -182,35 +164,31 @@ require (
182164
go.etcd.io/bbolt v1.4.3 // indirect
183165
go.mongodb.org/mongo-driver v1.17.9 // indirect
184166
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
185-
go.opentelemetry.io/contrib/detectors/gcp v1.43.0 // indirect
186-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.68.0 // indirect
187167
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.68.0 // indirect
188168
go.opentelemetry.io/otel v1.43.0 // indirect
189169
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0 // indirect
190170
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.43.0 // indirect
191171
go.opentelemetry.io/otel/metric v1.43.0 // indirect
192172
go.opentelemetry.io/otel/sdk v1.43.0 // indirect
193-
go.opentelemetry.io/otel/sdk/metric v1.43.0 // indirect
194173
go.opentelemetry.io/otel/trace v1.43.0 // indirect
195174
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
196175
go.uber.org/atomic v1.11.0 // indirect
197176
go.uber.org/multierr v1.11.0 // indirect
198-
go.uber.org/zap v1.27.1 // indirect
177+
go.uber.org/zap v1.28.0 // indirect
199178
go.yaml.in/yaml/v2 v2.4.4 // indirect
200-
golang.org/x/mod v0.35.0 // indirect
201-
golang.org/x/net v0.53.0 // indirect
179+
golang.org/x/arch v0.27.0 // indirect
180+
golang.org/x/mod v0.36.0 // indirect
181+
golang.org/x/net v0.54.0 // indirect
202182
golang.org/x/oauth2 v0.36.0 // indirect
203183
golang.org/x/sync v0.20.0 // indirect
204-
golang.org/x/sys v0.43.0 // indirect
205-
golang.org/x/text v0.36.0 // indirect
184+
golang.org/x/sys v0.44.0 // indirect
185+
golang.org/x/text v0.37.0 // indirect
206186
golang.org/x/time v0.15.0 // indirect
207-
golang.org/x/tools v0.44.0 // indirect
208-
google.golang.org/api v0.272.0 // indirect
209-
google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7 // indirect
210-
google.golang.org/genproto/googleapis/api v0.0.0-20260420184626-e10c466a9529 // indirect
211-
google.golang.org/genproto/googleapis/rpc v0.0.0-20260420184626-e10c466a9529 // indirect
212-
google.golang.org/grpc v1.80.0 // indirect
213-
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.1 // indirect
187+
golang.org/x/tools v0.45.0 // indirect
188+
google.golang.org/genproto/googleapis/api v0.0.0-20260511170946-3700d4141b60 // indirect
189+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260511170946-3700d4141b60 // indirect
190+
google.golang.org/grpc v1.81.1 // indirect
191+
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.2 // indirect
214192
gopkg.in/yaml.v3 v3.0.1 // indirect
215193
modernc.org/libc v1.70.0 // indirect
216194
modernc.org/mathutil v1.7.1 // indirect

0 commit comments

Comments
 (0)