Skip to content

chore: setup workflow for build & release #3

chore: setup workflow for build & release

chore: setup workflow for build & release #3

Workflow file for this run

name: Build and Release
on:
workflow_dispatch:
push:
tags:
- 'v*'
env:
QT_VERSION: 6.10.2
permissions:
contents: write
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{ env.QT_VERSION }}
arch: win64_msvc2022_64
cache: true
- name: Configure
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build --config Release
- name: Deploy (windeployqt)
shell: pwsh
run: |
mkdir dist
copy build\Release\PTCLTool.exe dist\
copy build\Release\iconv.dll dist\
windeployqt dist\PTCLTool.exe --release --compiler-runtime
Compress-Archive dist PTCLTool-${{ github.ref_name }}-windows.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: windows
path: PTCLTool-${{ github.ref_name }}-windows.zip
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{ env.QT_VERSION }}
arch: clang_64
cache: true
- name: Configure
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build --config Release
- name: Deploy (macdeployqt)
run: |
macdeployqt build/PTCLTool.app -dmg
mv build/PTCLTool.dmg PTCLTool-${{ github.ref_name }}-macos.dmg
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: macos
path: PTCLTool-${{ github.ref_name }}-macos.dmg
release:
runs-on: ubuntu-latest
needs: [build-windows, build-macos]
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
files: |
windows/PTCLTool-${{ github.ref_name }}-windows.zip
macos/PTCLTool-${{ github.ref_name }}-macos.dmg
draft: true
generate_release_notes: true