Skip to content

Build and Release

Build and Release #9

name: Build and Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.6.0'
- name: Set up MSVC (Windows only)
if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
- name: Build relay-pc (Windows)
if: matrix.os == 'windows-latest'
run: |
qmake6
nmake
- name: Build relay-pc
if: matrix.os != 'windows-latest'
shell: bash
run: |
qmake6
make -j$(nproc || sysctl -n hw.ncpu || echo 2)
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: relay-pc-${{ matrix.os }}
path: ${{ matrix.os == 'windows-latest' && 'relay-pc.exe' || 'relay-pc' }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/*/relay-pc
artifacts/*/relay-pc.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}