____ _ _______ __
/ __ \ | /| / / __/ |/ /
/ /_/ / |/ |/ / _// /
\____/|__/|__/___/_||_/
owenrtc / .github/workflows/release.yml
name: release
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
build-olcrtc:
name: build olcrtc ${{ matrix.os }}/${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- os: linux
arch: amd64
runner: ubuntu-latest
- os: linux
arch: arm64
runner: ubuntu-latest
- os: darwin
arch: amd64
runner: macos-latest
- os: darwin
arch: arm64
runner: macos-latest
- os: windows
arch: amd64
runner: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-go@v5
with:
go-version: "1.26"
- name: verify submodule
shell: bash
run: |
ls -la olcrtc/cmd/olcrtc/
cat olcrtc/go.mod | head -3
- name: build olcrtc
shell: bash
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: 0
run: |
cd olcrtc
go build -trimpath -ldflags="-s -w" -o "$GITHUB_WORKSPACE/olcrtc-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.os == 'windows' && '.exe' || '' }}" ./cmd/olcrtc
ls -la "$GITHUB_WORKSPACE/olcrtc-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.os == 'windows' && '.exe' || '' }}"
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: olcrtc-${{ matrix.os }}-${{ matrix.arch }}
path: olcrtc-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.os == 'windows' && '.exe' || '' }}
if-no-files-found: error
build-owenrtc:
name: build owenrtc ${{ matrix.os }}/${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
needs: build-olcrtc
strategy:
matrix:
include:
- os: linux
arch: amd64
runner: ubuntu-latest
ext: ""
- os: windows
arch: amd64
runner: windows-latest
ext: ".exe"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-go@v5
with:
go-version: "1.26"
- name: build owenrtc
shell: bash
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: 0
run: |
go build -trimpath -ldflags="-s -w" -o "owenrtc-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.ext }}" ./cmd/owenrtc
ls -la "owenrtc-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.ext }}"
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: owenrtc-${{ matrix.os }}-${{ matrix.arch }}
path: owenrtc-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.ext }}
if-no-files-found: error
release:
name: create release
runs-on: ubuntu-latest
needs: [build-olcrtc, build-owenrtc]
steps:
- name: download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: list artifacts
shell: bash
run: find artifacts -type f
- name: create release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/olcrtc-*/*
artifacts/owenrtc-*/*
generate_release_notes: true
fail_on_unmatched_files: true