Files
GitAddonsManager/.github/workflows/release.yml
T

80 lines
2.1 KiB
YAML

name: Build and Release
on:
release:
types: [published]
jobs:
build-and-release:
runs-on: windows-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up MSVC (Visual Studio Compiler)
uses: ilammy/msvc-dev-cmd@v1
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Cache Qt
id: cache-qt
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/Qt
key: qt-6.8.3-msvc2022_64
- name: Install Qt via aqtinstall
if: steps.cache-qt.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
pip install aqtinstall
python -m aqt install-qt windows desktop 6.8.3 win64_msvc2022_64 --outputdir ${{ github.workspace }}/Qt
- name: Add Qt to PATH
run: |
echo "${{ github.workspace }}/Qt/6.8.3/msvc2022_64/bin" >> $GITHUB_PATH
- name: Install libgit2 via vcpkg
run: |
vcpkg install libgit2:x64-windows
- name: Configure CMake
run: |
$version = "${{ github.ref_name }}" -replace '^v', ''
cmake -B build -S . `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/Qt/6.8.3/msvc2022_64" `
-DLIBGIT2_INCLUDE_DIR="C:/vcpkg/installed/x64-windows/include" `
-DLIBGIT2_LIBRARY="C:/vcpkg/installed/x64-windows/lib/git2.lib" `
-DCPACK_PACKAGE_VERSION="$version"
- name: Build Project
run: |
cmake --build build --config Release
- name: Install NSIS
run: choco install nsis -y
- name: Run CPack (Generate Installer)
working-directory: build
run: |
cpack -C Release
- name: Upload build artifacts on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: build-logs
path: build/
- name: Upload Artifacts to Release
uses: softprops/action-gh-release@v2
with:
files: build/GitAddonsManager-*.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}