go/.github/workflows/release.yml
dependabot[bot] ec12fed0a0
deps(actions): bump actions/download-artifact from 4 to 7 (#267)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Snider <snider@host.uk.com>
2026-02-04 01:00:11 +00:00

105 lines
2.5 KiB
YAML

name: Release
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
goos: linux
goarch: amd64
ext: ""
- os: ubuntu-latest
goos: linux
goarch: arm64
ext: ""
- os: macos-latest
goos: darwin
goarch: amd64
ext: ""
- os: macos-latest
goos: darwin
goarch: arm64
ext: ""
- os: windows-latest
goos: windows
goarch: amd64
ext: ".exe"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: true
- name: Build CLI
shell: bash
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: "0"
run: |
mkdir -p dist
go build -ldflags="-s -w -X main.Version=${{ github.ref_name }}" \
-o dist/core${{ matrix.ext }} \
.
- name: Create archive (Unix)
if: matrix.goos != 'windows'
shell: bash
run: |
cd dist
tar -czvf core-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz core
rm core
- name: Create archive (Windows)
if: matrix.goos == 'windows'
shell: pwsh
run: |
cd dist
Compress-Archive -Path core.exe -DestinationPath core-${{ matrix.goos }}-${{ matrix.goarch }}.zip
Remove-Item core.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: core-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/core-*
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v7
with:
path: dist
merge-multiple: true
- name: Prepare release files
run: |
mkdir -p release
cp dist/* release/ 2>/dev/null || true
ls -la release/
- name: Create release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ github.ref_name }} \
--title "Release ${{ github.ref_name }}" \
--generate-notes \
release/*