Skip to content

ci(release): add automated multi-arch GitHub release workflow #2

ci(release): add automated multi-arch GitHub release workflow

ci(release): add automated multi-arch GitHub release workflow #2

Workflow file for this run

name: CI
on:
push:
branches: [ master, main, dev ]
pull_request:
branches: [ master, main, dev ]
jobs:
test:
name: Test (${{ matrix.os }}, Go ${{ matrix.go-version }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
go-version: [ '1.22', '1.23' ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
check-latest: true
- name: Verify dependencies
run: go mod verify
- name: Run go vet
run: go vet ./...
- name: Run unit tests
run: go test -v ./...
build:
name: Cross-Platform Build
runs-on: ubuntu-latest
needs: test
strategy:
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: linux
goarch: arm
goarm: 7
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
- goos: windows
goarch: amd64
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Build binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
CGO_ENABLED: 0
run: |
OUTPUT="transmission-telegram-${{ matrix.goos }}-${{ matrix.goarch }}"
if [ "${{ matrix.goos }}" = "windows" ]; then
OUTPUT="${OUTPUT}.exe"
fi
go build -v -o "${OUTPUT}" ./cmd/bot/