-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github workflow that provides build when release
- Loading branch information
Showing
3 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: C++ Build and Package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
env: | ||
TAG_NAME: ${{ github.ref_name }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build (Release) | ||
run: | | ||
cmake -S ${{github.workspace}}/MakeFarm -B ${{github.workspace}}/build-release -DCMAKE_BUILD_TYPE=Release | ||
cmake --build ${{github.workspace}}/build-release --config Release --target MakeFarmApp | ||
- name: Package (Release) | ||
run: | | ||
Compress-Archive -Path "${{github.workspace}}/build-release/src/Release/*" -DestinationPath "${{github.workspace}}/build-release/src/makefarm_release_windows_build_${{ env.TAG_NAME }}.zip" | ||
- name: Build (Debug) | ||
run: | | ||
cmake -S ${{github.workspace}}/MakeFarm -B ${{github.workspace}}/build-debug -DCMAKE_BUILD_TYPE=Debug | ||
cmake --build ${{github.workspace}}/build-debug --config Debug --target MakeFarmApp | ||
- name: Package (Debug) | ||
run: | | ||
$excludeExtensions = @('.pdb', '.ilk', '.cmake') | ||
$excludeFiles = @('MakeFarmSrc.lib') | ||
$excludeFolders = @('custom_includes', 'CMakeFiles') | ||
$filesToCompress = Get-ChildItem "${{github.workspace}}/build-debug/src/Debug/*" -Recurse | Where-Object { | ||
$excludeExtensions -notcontains $_.Extension -and | ||
$excludeFiles -notcontains $_.Name -and | ||
$excludeFolders -notcontains $_.Directory.Name | ||
} | ||
if ($filesToCompress.Count -gt 0) { | ||
Compress-Archive -Path $filesToCompress.FullName -DestinationPath "${{github.workspace}}/build-debug/src/makefarm_debug_windows_build_${{ env.TAG_NAME }}.zip" | ||
} else { | ||
Write-Host "No files match the criteria for compression." | ||
} | ||
|
||
- name: List files before upload release assets | ||
run: Get-ChildItem | ||
|
||
- name: Upload Release Assets | ||
uses: AButler/upload-release-assets@v3.0 | ||
with: | ||
files: "./build-release/src/makefarm_release_windows_build_*.zip;./build-debug/src/makefarm_debug_windows_build_*.zip" | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters