Skip to content

Workflow file for this run

name: "Go Build and Release by GoReleaser"
on:
push:
tags:
- "v*.*.*"
jobs:
build-linux-version:
runs-on: self-hosted
steps:
- name: "Checkout code"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Set up Go"
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: "Build via GoReleaser"
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --skip publish --config .goreleaser-linux.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Upload artifact"
uses: actions/upload-artifact@v4
with:
name: eniac-linux
path: dist/eniac*.*
build-darwin-version:
runs-on: macos-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Set up Go"
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: "Build via GoReleaser"
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --skip publish --config .goreleaser-darwin.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Upload artifact"
uses: actions/upload-artifact@v4
with:
name: eniac-darwin
path: dist/eniac*.*
release:
needs: [build-linux-version, build-darwin-version]
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Make directories"
run: |
mkdir -p build/linux
mkdir -p build/darwin
- name: "Download linux artifact"
uses: actions/download-artifact@v4
with:
name: eniac-linux
path: build/linux
- name: "Download darwin artifact"
uses: actions/download-artifact@v4
with:
name: eniac-darwin
path: build/darwin
- name: "Merge checksum file"
run: |
cd build
cat linux/eniac*checksums.txt >> checksums.txt && rm linux/eniac*checksums.txt
cat darwin/eniac*checksums.txt >> checksums.txt && rm darwin/eniac*checksums.txt
- name: "Release"
uses: goreleaser/goreleaser-action@v6
with:
args: release --config .goreleaser-release.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}