molecule-cli/.github/workflows/release.yml
Molecule AI SDK-Dev d263a30f84 fix(ci): narrow test/vet job to ./cmd/molecule/... package
The repo has no Go files at the root — go test ./... and go vet ./...
fail with "no Go files in ." in CI. Narrow the test job to the only
package with tests, and vet to the scoped package dirs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 10:34:04 +00:00

57 lines
1.4 KiB
YAML

name: Release Go binaries
on:
push:
tags: ['v*']
pull_request:
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with: { go-version: '1.25' }
- name: Tidy
run: go mod tidy && git diff --exit-code go.sum
- name: Vet
run: go vet ./cmd/molecule/... ./internal/client/... ./internal/cmd/...
- name: Test
run: go test ./cmd/molecule/...
release:
runs-on: ubuntu-latest
needs: [test]
strategy:
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
- goos: windows
goarch: amd64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with: { go-version: '1.25' }
- name: Build
run: |
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} \
go build -o molecule-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.exe' || '' }} \
./cmd/molecule
- uses: softprops/action-gh-release@v2
with:
files: molecule-*
if: startsWith(github.ref, 'refs/tags/v')