Skip to content

Commit cae9b7c

Browse files
intel352claude
andcommitted
feat: add GitHub Actions release workflow and update workflow to v0.1.9
- Add .github/workflows/release.yml: builds linux/darwin amd64/arm64 binaries, creates tar.gz archives named workflow-plugin-admin-{os}-{arch}.tar.gz, and publishes GitHub Release with checksums and plugin.json on v* tags - Add .github/workflows/ci.yml: vet, fmt check, and cross-platform build matrix - Upgrade github.com/GoCodeAlone/workflow v0.1.7 → v0.1.9 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f7c7731 commit cae9b7c

4 files changed

Lines changed: 144 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
GONOSUMCHECK: github.com/GoCodeAlone/*
11+
GONOSUMDB: github.com/GoCodeAlone/*
12+
GOPRIVATE: github.com/GoCodeAlone/*
13+
14+
jobs:
15+
lint:
16+
name: Lint
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: actions/setup-go@v5
22+
with:
23+
go-version: '1.26'
24+
cache: true
25+
26+
- name: Resolve dependencies
27+
run: go mod tidy
28+
29+
- name: Run go vet
30+
run: go vet ./...
31+
32+
- name: Run go fmt check
33+
run: |
34+
if [ "$(gofmt -l . | wc -l)" -gt 0 ]; then
35+
echo "The following files are not formatted:"
36+
gofmt -l .
37+
exit 1
38+
fi
39+
40+
build:
41+
name: Cross-platform Build
42+
runs-on: ubuntu-latest
43+
strategy:
44+
matrix:
45+
include:
46+
- goos: linux
47+
goarch: amd64
48+
- goos: linux
49+
goarch: arm64
50+
- goos: darwin
51+
goarch: amd64
52+
- goos: darwin
53+
goarch: arm64
54+
steps:
55+
- uses: actions/checkout@v4
56+
57+
- uses: actions/setup-go@v5
58+
with:
59+
go-version: '1.26'
60+
cache: true
61+
62+
- name: Resolve dependencies
63+
run: go mod tidy
64+
65+
- name: Build ${{ matrix.goos }}/${{ matrix.goarch }}
66+
env:
67+
GOOS: ${{ matrix.goos }}
68+
GOARCH: ${{ matrix.goarch }}
69+
run: |
70+
go build -o bin/workflow-plugin-admin-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/workflow-plugin-admin

.github/workflows/release.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
env:
12+
GONOSUMCHECK: github.com/GoCodeAlone/*
13+
GONOSUMDB: github.com/GoCodeAlone/*
14+
GOPRIVATE: github.com/GoCodeAlone/*
15+
16+
jobs:
17+
release:
18+
name: Build and Release
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- uses: actions/setup-go@v5
26+
with:
27+
go-version: '1.26'
28+
cache: true
29+
30+
- name: Resolve dependencies
31+
run: go mod tidy
32+
33+
- name: Build binaries
34+
run: |
35+
VERSION=${GITHUB_REF#refs/tags/}
36+
37+
declare -a PLATFORMS=("linux/amd64" "linux/arm64" "darwin/amd64" "darwin/arm64")
38+
mkdir -p bin
39+
40+
for platform in "${PLATFORMS[@]}"; do
41+
os="${platform%%/*}"
42+
arch="${platform##*/}"
43+
output="bin/workflow-plugin-admin-${os}-${arch}"
44+
echo "Building ${output}..."
45+
GOOS=${os} GOARCH=${arch} go build -ldflags "-X main.version=${VERSION}" \
46+
-o "${output}" ./cmd/workflow-plugin-admin
47+
done
48+
49+
ls -la bin/
50+
51+
- name: Create release archives
52+
run: |
53+
mkdir -p dist
54+
for binary in bin/workflow-plugin-admin-*; do
55+
name=$(basename "${binary}")
56+
tar -czf "dist/${name}.tar.gz" -C bin "${name}"
57+
sha256sum "dist/${name}.tar.gz" >> dist/checksums.txt
58+
done
59+
cp plugin.json dist/
60+
ls -la dist/
61+
62+
- name: Create GitHub Release
63+
uses: softprops/action-gh-release@v2
64+
with:
65+
files: |
66+
dist/*.tar.gz
67+
dist/checksums.txt
68+
dist/plugin.json
69+
generate_release_notes: true
70+
draft: false
71+
prerelease: false

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/GoCodeAlone/workflow-plugin-admin
33
go 1.26
44

55
require (
6-
github.com/GoCodeAlone/workflow v0.1.7
6+
github.com/GoCodeAlone/workflow v0.1.9
77
gopkg.in/yaml.v3 v3.0.1
88
)
99

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ github.com/DataDog/datadog-go/v5 v5.4.0 h1:Ea3eXUVwrVV28F/fo3Dr3aa+TL/Z7Xi6SUPKW
3636
github.com/DataDog/datadog-go/v5 v5.4.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw=
3737
github.com/GoCodeAlone/go-plugin v0.0.0-20260220090904-b4c35f0e4271 h1:/oxxpYJ41BuK+/5Gp9c+0PHybyNFWeBHyCzkSVLCoMk=
3838
github.com/GoCodeAlone/go-plugin v0.0.0-20260220090904-b4c35f0e4271/go.mod h1:HbGQRZUIa+jbDfjsaZIMJYvrz+LnxL0mJpggfynSTMk=
39-
github.com/GoCodeAlone/workflow v0.1.7 h1:M4srW5W6nN19hMG8suJPNAnOHTo+hfybyg96vthRQU8=
40-
github.com/GoCodeAlone/workflow v0.1.7/go.mod h1:v0qTmIgwrBUhwOCN2x759c/hjVoKh9L1WalfJ1SW3iI=
39+
github.com/GoCodeAlone/workflow v0.1.9 h1:Wj3rLnP6TXhquzXN4X/YEIrhTO5vXisr8N9pJbcX2gw=
40+
github.com/GoCodeAlone/workflow v0.1.9/go.mod h1:v0qTmIgwrBUhwOCN2x759c/hjVoKh9L1WalfJ1SW3iI=
4141
github.com/GoCodeAlone/yaegi v0.17.1 h1:aPAwU29L9cGceRAff02c5pjQcT5KapDB4fWFZK9tElE=
4242
github.com/GoCodeAlone/yaegi v0.17.1/go.mod h1:z5Pr6Wse6QJcQvpgxTxzMAevFarH0N37TG88Y9dprx0=
4343
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 h1:sBEjpZlNHzK1voKq9695PJSX2o5NEXl7/OL3coiIY0c=

0 commit comments

Comments
 (0)