Skip to content

re: simplify package structure #9

re: simplify package structure

re: simplify package structure #9

Workflow file for this run

# This workflow will build a golang project and create a release with generated binaries
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Build and Release Go binaries
on:
push:
tags: ["v*"]
# Allows running this workflow from GitHub Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow releases
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22"
- name: Build for Linux (x86-64)
env:
GOOS: linux
GOARCH: amd64
run: go build -C cmd/ytgo -o "../../bin/ytgo-${GOOS}-${GOARCH}"
- name: Build for Linux (ARM64)
env:
GOOS: linux
GOARCH: arm64
run: go build -C cmd/ytgo -o "../../bin/ytgo-${GOOS}-${GOARCH}"
- name: Build for MacOS (x86-64)
env:
GOOS: darwin
GOARCH: amd64
run: go build -C cmd/ytgo -o "../../bin/ytgo-${GOOS}-${GOARCH}"
- name: Build for MacOS (ARM64)
env:
GOOS: darwin
GOARCH: arm64
run: go build -C cmd/ytgo -o "../../bin/ytgo-${GOOS}-${GOARCH}"
- name: Build for Windows (x86-64)
env:
GOOS: windows
GOARCH: amd64
run: go build -C cmd/ytgo -o "../../bin/ytgo-${GOOS}-${GOARCH}.exe"
- name: Build for Windows (ARM64)
env:
GOOS: windows
GOARCH: arm64
run: go build -C cmd/ytgo -o "../../bin/ytgo-${GOOS}-${GOARCH}.exe"
- name: Create Release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
bin/ytgo-*