Skip to content

build: fix errors in build windows executables #23

build: fix errors in build windows executables

build: fix errors in build windows executables #23

Workflow file for this run

name: Go CI/CD
on:
push:
branches: [ "main" ]
tags: [ "v*.*.*" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
goos: linux
ext: ""
- os: windows-latest
goos: windows
ext: ".exe"
- os: macos-latest
goos: darwin
ext: ""
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.23.0'
- name: Build artifact
env:
GOOS: ${{ matrix.goos }}
GOARCH: amd64
run: |
mkdir -p bin
go build -v \
-ldflags "-s -w" \
-o bin/terminalapp_${{ matrix.goos }}_amd64${{ matrix.ext }} \
./cmd/terminalapp/main
- uses: actions/upload-artifact@v4
with:
name: terminalapp-${{ matrix.goos }}-amd64
path: bin/terminalapp_${{ matrix.goos }}_amd64${{ matrix.ext }}
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v4
with:
path: ./bin
- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
files: ./bin/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}