- ci.yml: Download latest dev release, run `core go qa`, build matrix - release.yml: Use go-version-file, consistent artifact handling - dev-release.yml: Add checksums, cleaner version string - coverage.yml: Standardize setup-go version, add CLI verification All workflows now use: - go-version-file for consistent Go version - upload-artifact@v4 / download-artifact@v4 - Proper version injection via ldflags Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
97 lines
2.4 KiB
YAML
97 lines
2.4 KiB
YAML
name: Dev Release
|
|
|
|
on:
|
|
push:
|
|
branches: [dev]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- goos: linux
|
|
goarch: amd64
|
|
- goos: linux
|
|
goarch: arm64
|
|
- goos: darwin
|
|
goarch: amd64
|
|
- goos: darwin
|
|
goarch: arm64
|
|
- goos: windows
|
|
goarch: amd64
|
|
- goos: windows
|
|
goarch: arm64
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
|
|
- name: Build CLI
|
|
env:
|
|
GOOS: ${{ matrix.goos }}
|
|
GOARCH: ${{ matrix.goarch }}
|
|
CGO_ENABLED: '0'
|
|
run: |
|
|
EXT=""
|
|
if [ "$GOOS" = "windows" ]; then EXT=".exe"; fi
|
|
VERSION="dev-$(git rev-parse --short HEAD)"
|
|
go build -trimpath \
|
|
-ldflags="-s -w -X github.com/host-uk/core/pkg/cli.AppVersion=${VERSION}" \
|
|
-o core-${GOOS}-${GOARCH}${EXT} .
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: core-${{ matrix.goos }}-${{ matrix.goarch }}
|
|
path: core-*
|
|
|
|
release:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
merge-multiple: true
|
|
|
|
- name: Generate checksums
|
|
run: |
|
|
cd artifacts
|
|
sha256sum core-* > CHECKSUMS.txt
|
|
cat CHECKSUMS.txt
|
|
|
|
- name: Delete existing dev release
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: gh release delete dev -y || true
|
|
|
|
- name: Delete existing dev tag
|
|
run: git push origin :refs/tags/dev || true
|
|
|
|
- name: Create dev release
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
gh release create dev \
|
|
--title "Development Build" \
|
|
--notes "Latest development build from the dev branch.
|
|
|
|
**Commit:** ${{ github.sha }}
|
|
**Built:** $(date -u +'%Y-%m-%d %H:%M:%S UTC')
|
|
|
|
This is a pre-release for testing. Use tagged releases for production." \
|
|
--prerelease \
|
|
--target dev \
|
|
artifacts/*
|