Skip to content

bump static-opus to v0.9.152 #15

bump static-opus to v0.9.152

bump static-opus to v0.9.152 #15

Workflow file for this run

name: Build and Test
on:
push:
branches: [master, main]
tags:
- 'v*'
pull_request:
branches: [master, main]
env:
GO_VERSION: '1.24'
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgl1-mesa-dev \
libxcursor-dev \
libxrandr-dev \
libxinerama-dev \
libxi-dev \
libxxf86vm-dev \
libasound2-dev \
libxcb-util-dev \
libxcb-icccm4-dev \
libxcb-xfixes0-dev \
pkg-config
- name: Add static library replacements
run: |
go mod edit -replace github.com/gordonklaus/portaudio=github.com/KarpelesLab/[email protected]
go mod edit -replace github.com/hraban/opus=github.com/KarpelesLab/[email protected]
go get .
- name: Run tests
run: go test -v ./...
build-linux:
name: Build Linux
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgl1-mesa-dev \
libxcursor-dev \
libxrandr-dev \
libxinerama-dev \
libxi-dev \
libxxf86vm-dev \
libasound2-dev \
libxcb-util-dev \
libxcb-icccm4-dev \
libxcb-xfixes0-dev \
pkg-config
- name: Add static library replacements
run: |
go mod edit -replace github.com/gordonklaus/portaudio=github.com/KarpelesLab/[email protected]
go mod edit -replace github.com/hraban/opus=github.com/KarpelesLab/[email protected]
go get .
- name: Build
run: |
CGO_ENABLED=1 go build -v -ldflags="-s -w" -o shells-go-linux-amd64 .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: shells-go-linux-amd64
path: shells-go-linux-amd64
build-windows:
name: Build Windows
runs-on: windows-latest
needs: test
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-go
mingw-w64-x86_64-pkg-config
- name: Add static library replacements
run: |
go mod edit -replace github.com/gordonklaus/portaudio=github.com/KarpelesLab/[email protected]
go mod edit -replace github.com/hraban/opus=github.com/KarpelesLab/[email protected]
go get .
- name: Build
run: |
export CGO_ENABLED=1
go build -v -ldflags="-s -w" -o shells-go-windows-amd64.exe .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: shells-go-windows-amd64
path: shells-go-windows-amd64.exe
build-macos-intel:
name: Build macOS Intel
runs-on: macos-15-intel
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Add static library replacements
run: |
go mod edit -replace github.com/gordonklaus/portaudio=github.com/KarpelesLab/[email protected]
go mod edit -replace github.com/hraban/opus=github.com/KarpelesLab/[email protected]
go get .
- name: Build
run: |
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -v -ldflags="-s -w" -o shells-go-darwin-amd64 .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: shells-go-darwin-amd64
path: shells-go-darwin-amd64
build-macos-arm:
name: Build macOS ARM + Universal Binary
runs-on: macos-latest
needs: [test, build-macos-intel]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Add static library replacements
run: |
go mod edit -replace github.com/gordonklaus/portaudio=github.com/KarpelesLab/[email protected]
go mod edit -replace github.com/hraban/opus=github.com/KarpelesLab/[email protected]
go get .
- name: Build ARM64
run: |
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -v -ldflags="-s -w" -o shells-go-darwin-arm64 .
- name: Download Intel binary
uses: actions/download-artifact@v4
with:
name: shells-go-darwin-amd64
- name: Create Universal Binary
run: |
lipo -create -output shells-go-darwin-universal shells-go-darwin-amd64 shells-go-darwin-arm64
file shells-go-darwin-universal
- name: Upload ARM64 artifact
uses: actions/upload-artifact@v4
with:
name: shells-go-darwin-arm64
path: shells-go-darwin-arm64
- name: Upload Universal Binary artifact
uses: actions/upload-artifact@v4
with:
name: shells-go-darwin-universal
path: shells-go-darwin-universal
release:
name: Create Release
runs-on: ubuntu-latest
needs: [build-linux, build-windows, build-macos-arm]
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Prepare release assets
run: |
mkdir -p release
VERSION=${GITHUB_REF#refs/tags/}
# Linux - tar.gz
tar -czvf release/shells-go-linux-amd64-${VERSION}.tar.gz \
-C artifacts/shells-go-linux-amd64 shells-go-linux-amd64
# Windows - zip
cd artifacts/shells-go-windows-amd64
zip ../../release/shells-go-windows-amd64-${VERSION}.zip shells-go-windows-amd64.exe
cd ../..
# macOS Intel - tar.gz
tar -czvf release/shells-go-darwin-amd64-${VERSION}.tar.gz \
-C artifacts/shells-go-darwin-amd64 shells-go-darwin-amd64
# macOS ARM - tar.gz
tar -czvf release/shells-go-darwin-arm64-${VERSION}.tar.gz \
-C artifacts/shells-go-darwin-arm64 shells-go-darwin-arm64
# macOS Universal - tar.gz
tar -czvf release/shells-go-darwin-universal-${VERSION}.tar.gz \
-C artifacts/shells-go-darwin-universal shells-go-darwin-universal
# Generate checksums
cd release
sha256sum * > checksums.txt
- name: Create Release
uses: softprops/action-gh-release@v2
with:
draft: false
generate_release_notes: true
files: release/*