Skip to content

release

release #4

Workflow file for this run

name: release
on:
workflow_dispatch:
inputs:
tag:
description: "Release tag (for example, v0.1.0)"
required: true
type: string
draft:
description: "Create as draft"
required: false
type: boolean
default: false
prerelease:
description: "Mark as prerelease"
required: false
type: boolean
default: false
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
goos: [linux]
goarch: [amd64]
include:
- goos: linux
ext: ""
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
cache: true
- name: Install native dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
pkg-config \
libopus-dev \
libopusfile-dev \
libx11-dev \
libxtst-dev \
xvfb \
xauth
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
mkdir -p dist
server_name="dialtone-server-${{ inputs.tag }}-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.ext }}"
client_name="dialtone-client-${{ inputs.tag }}-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.ext }}"
go build -o "dist/${server_name}" ./cmd/server
go build -o "dist/${client_name}" ./cmd/client
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/*
publish:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist
pattern: dist-*
merge-multiple: true
- name: Create release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.tag }}
name: ${{ inputs.tag }}
draft: ${{ inputs.draft }}
prerelease: ${{ inputs.prerelease }}
files: dist/**