Skip to content

Commit

Permalink
Build and release Windows binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
ThreeDeeJay authored Jul 18, 2024
1 parent b3e4dd8 commit 4580d40
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build

env:
Configuration: Release
Artifacts: build/Release
Branch: ${{github.ref_name}}

on:
push:
Branches: $Branch
pull_request:
Branches: $Branch
workflow_dispatch:

permissions:
contents: write

jobs:
Windows:
runs-on: windows-latest
steps:

- name: Clone repo and submodules
run: git clone --recurse-submodules https://github.com/${{github.repository}}.git .

- name: Get current date, commit hash and count
run: |
echo "CommitDate=$(git show -s --date=format:'%Y-%m-%d' --format=%cd)" >> $env:GITHUB_ENV
echo "CommitHashShort=$(git rev-parse --short=7 HEAD)" >> $env:GITHUB_ENV
echo "CommitCount=$(git rev-list --count ${{env.Branch}})" >> $env:GITHUB_ENV
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.6.0'
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2019_64'
modules: 'addons.qtmultimedia'

- name: Build
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.Configuration}}
cmake --build ${{github.workspace}}/build --config ${{env.Configuration}}
windeployqt.exe "${{github.workspace}}/${{env.Artifacts}}/bino.exe"
- name: Upload Installer Artifact to GitHub
uses: actions/upload-artifact@v2
with:
name: "${{github.event.repository.name}}_r${{env.CommitCount}}@${{env.CommitHashShort}}"
path: "${{github.workspace}}/${{env.Artifacts}}/"

- name: Compress artifacts
uses: vimtor/[email protected]
with:
files: '${{env.Artifacts}}/'
dest: "build/${{github.event.repository.name}}_r${{env.CommitCount}}@${{env.CommitHashShort}}.zip"

- name: GitHub pre-release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{secrets.GITHUB_TOKEN}}"
automatic_release_tag: "latest"
prerelease: false
title: "[${{env.CommitDate}}] ${{github.event.repository.name}} r${{env.CommitCount}}@${{env.CommitHashShort}}"
files: "build/${{github.event.repository.name}}_r${{env.CommitCount}}@${{env.CommitHashShort}}.zip"

0 comments on commit 4580d40

Please sign in to comment.