Files
go-ts/.gitea/workflows/build.yml
Jose Luis Montañes Ojados 9ed1d4f60e
All checks were successful
Build and Release / build-linux (push) Successful in 33s
Build and Release / build-windows (push) Successful in 1m54s
Build and Release / release (push) Successful in 8s
ci: automate release notes generation using git log
2026-01-17 03:15:53 +01:00

118 lines
3.1 KiB
YAML

name: Build and Release
on:
push:
branches: [master]
tags: ['v*']
jobs:
build-windows:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
cache: false
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
path-type: inherit
update: true
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-opus
mingw-w64-x86_64-opusfile
mingw-w64-x86_64-portaudio
mingw-w64-x86_64-pkgconf
zip
- name: Build TUI
run: |
export CGO_ENABLED=1
mkdir -p dist
# More descriptive name: ts3-tui
go build -o dist/ts3-tui.exe ./cmd/tui
# Copy DLLs
cp /mingw64/bin/libogg-0.dll dist/
cp /mingw64/bin/libopus-0.dll dist/
cp /mingw64/bin/libopusfile-0.dll dist/
cp /mingw64/bin/libportaudio-2.dll dist/ || true
# Create ZIP with architecture name
cd dist && zip -r ../ts3-tui-windows-x86_64.zip . *
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ts3-tui-windows-zip
path: ts3-tui-windows-x86_64.zip
build-linux:
runs-on: linux-x86_64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
cache: false
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libportaudio2 portaudio19-dev \
libopus-dev libopusfile-dev \
libpulse-dev pkg-config gcc
- name: Build TUI
run: |
export CGO_ENABLED=1
export ARCH=$(uname -m)
mkdir -p dist
# More descriptive name: ts3-tui-linux-ARCH
go build -o dist/ts3-tui-linux-${ARCH} ./cmd/tui
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ts3-tui-linux-binaries
path: dist/*
release:
needs: [build-windows, build-linux]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate Changelog
run: |
# Get commits since the last tag (or since the beginning)
git log --oneline $(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || git rev-list --max-parents=0 HEAD)..HEAD > changelog.txt
- name: Download Artifacts
uses: actions/download-artifact@v3
- name: Create Release
uses: softprops/action-gh-release@v1
with:
body_path: changelog.txt
files: |
ts3-tui-windows-zip/ts3-tui-windows-x86_64.zip
ts3-tui-linux-binaries/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}