Skip to content

Release

Release #5

Workflow file for this run

name: Release
on:
push:
tags:
- '*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to release'
required: true
default: 'v0.0.1'
permissions:
contents: write
jobs:
build:
name: Build
strategy:
matrix:
include:
- os: ubuntu-latest
goos: linux
goarch: [ 386, amd64, arm, arm64 ]
- os: macos-latest
goos: darwin
goarch: [amd64] # Only build for amd64 on macOS
- os: windows-latest
goos: windows
goarch: [ 386, amd64, arm, arm64 ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
- name: Build binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
go build -v -o networkHub-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/main.go
- name: Upload Executable
uses: xresloader/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name || inputs.tag }}
file: networkHub-${{ matrix.goos }}-${{ matrix.goarch }}${{ runner.os == 'Windows' && '.exe' }}