Skip to content

Update main.yml

Update main.yml #5

Workflow file for this run

name: Build and Release LogViewer
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Qt
uses: jurplel/install-qt-action@v2
with:
version: '5.14.2'
host: 'linux'
- name: Install dependencies
run: sudo apt-get install -y build-essential qt5-qmake qtbase5-dev
- name: Configure with qmake
run: |
qmake -o Makefile LogReader.pro
- name: Build LogViewer
run: |
make
- name: Package for Linux
run: |
mkdir -p release/linux
cp LogViewer release/linux/
linuxdeploy --appdir=release/linux --output appimage
build_windows:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Qt
uses: jurplel/install-qt-action@v2
with:
version: '5.14.2'
host: 'windows'
- name: Install MinGW
run: |
choco install mingw
- name: Add MinGW to PATH
run: |
echo "::add-path::C:\ProgramData\chocolatey\bin"
- name: Configure with qmake
shell: cmd
run: |
qmake -o Makefile LogReader.pro
- name: Build LogViewer
shell: cmd
run: |
mingw32-make
- name: Package for Windows
run: |
mkdir -p release/windows
windeployqt --release LogViewer.exe
mv LogViewer.exe release/windows/
build_macos:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Qt
uses: jurplel/install-qt-action@v2
with:
version: '5.14.2'
host: 'mac'
- name: Configure with qmake
run: |
qmake -o Makefile LogReader.pro
- name: Build LogViewer
run: |
make
- name: Package for macOS
run: |
mkdir -p release/macos
macdeployqt LogViewer.app
mv LogViewer.app release/macos/
release:
runs-on: ubuntu-latest
needs: [build, build_windows, build_macos]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Upload compiled binaries
uses: actions/upload-artifact@v3
with:
name: LogViewer-Linux
path: release/linux/*
- name: Upload Windows binaries
uses: actions/upload-artifact@v3
with:
name: LogViewer-Windows
path: release/windows/*
- name: Upload macOS binaries
uses: actions/upload-artifact@v3
with:
name: LogViewer-macOS
path: release/macos/*
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
release/linux/*
release/windows/*
release/macos/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}