Skip to content

use sudo

use sudo #4

Workflow file for this run

name: build
on:
push:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup Go
uses: actions/setup-go@v4
with:
go-version: 'stable'
- name: set tag
id: tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: install dependencies
run: sudo apt -y install gcc-mingw-w64
- name: build
run: |
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CGO_CFLAGS="-D_LARGEFILE64_SOURCE" CC=x86_64-w64-mingw32-gcc go build -a -o bin/segments-win64-${{steps.tag.outputs.tag}}.exe
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 CGO_CFLAGS="-D_LARGEFILE64_SOURCE" go build -a -o bin/segments-linux64-${{steps.tag.outputs.tag}}
- name: release
uses: softprops/action-gh-release@v1
with:
files: bin/*
fail_on_unmatched_files: true
generate_release_notes: true