Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Squirrelies committed Jun 24, 2024
1 parent 2a08810 commit 1316224
Show file tree
Hide file tree
Showing 23 changed files with 1,819 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Ref: https://clang.llvm.org/docs/ClangFormatStyleOptions.html
BasedOnStyle: LLVM
UseTab: ForIndentation
IndentWidth: 4
TabWidth: 4
LineEnding: LF
BreakBeforeBraces: Allman
BreakBeforeConceptDeclarations: Always
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: true
ColumnLimit: 0
AccessModifierOffset: -4
NamespaceIndentation: All
FixNamespaceComments: false
106 changes: 106 additions & 0 deletions .github/workflows/ManualReleaseMain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: "Manual Release - Main"

on:
workflow_dispatch:
inputs:
workflowPreset:
description: "Configure/Build/Test/Package configuration"
required: false
default: "Release"
type: choice
options:
- "Release"
- "RelWithDebInfo"
- "MinSizeRel"
- "Debug"
versionMajor:
description: "Major Version"
required: false
default: 0
type: number
versionMinor:
description: "Minor Version"
required: false
default: 1
type: number
versionPatch:
description: "Patch Version"
required: false
default: 0
type: number

env:
VCPKG_ROOT: C:/vcpkg
MSYSTEM: clang64
ARCH: clang-x86_64

jobs:
Build:
name: Build w/ MSYS2
runs-on: windows-latest

defaults:
run:
shell: pwsh

steps:
- name: Setup MSYS2 ${{ env.MSYSTEM }} (${{ env.ARCH }})
uses: msys2/setup-msys2@v2
with:
msystem: ${{ env.MSYSTEM }}
release: false
update: true
cache: true
install: git base-devel mingw-w64-${{ env.ARCH }}-toolchain mingw-w64-${{ env.ARCH }}-cmake

- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref }}

- name: Get new build number
id: build-number
run: |
$build_number = $((${{ vars.BUILD_NUMBER }} + 1))
echo "current_build_number=$build_number" | Set-Content $env:GITHUB_OUTPUT
- name: Run CMake
shell: msys2 {0}
env:
RC_VERSION_MAJOR: ${{inputs.versionMajor}}
RC_VERSION_MINOR: ${{inputs.versionMinor}}
RC_VERSION_PATCH: ${{inputs.versionPatch}}
RC_VERSION_BUILD: ${{steps.build-number.outputs.current_build_number}}
run: cmake --workflow --preset ${{inputs.workflowPreset}} --fresh

- name: Run CTest
shell: msys2 {0}
run: ctest --preset ${{inputs.workflowPreset}} --output-on-failure

- name: Update build number variable
env:
GH_TOKEN: ${{ secrets.GH_VARIABLE_RW_TOKEN }}
run: gh variable set BUILD_NUMBER -b${{ steps.build-number.outputs.current_build_number }}

- name: Zip the publish artifacts
working-directory: ${{github.workspace}}
run: |
Add-Type -assembly 'System.IO.Compression'
Add-Type -assembly 'System.IO.Compression.FileSystem'
[System.IO.Compression.ZipArchive]$zipFile = [System.IO.Compression.ZipFile]::Open('SRTManager-v${{inputs.versionMajor}}.${{inputs.versionMinor}}.${{inputs.versionPatch}}-${{steps.build-number.outputs.current_build_number}}-${{inputs.workflowPreset}}.zip', ([System.IO.Compression.ZipArchiveMode]::Create))
[System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile($zipFile, 'build/SRTManager.exe', 'SRTManager.exe')
[System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile($zipFile, 'build/SRTManager.dll', 'SRTManager.dll')
[System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile($zipFile, 'LICENSE', 'LICENSE')
[System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile($zipFile, 'README.md', 'README.md')
$zipFile.Dispose()
- name: Publish release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{inputs.workflowPreset}}-build"
prerelease: true
title: "Manual Build [main] - v${{inputs.versionMajor}}.${{inputs.versionMinor}}.${{inputs.versionPatch}}-${{steps.build-number.outputs.current_build_number}} Release"
files: |
SRTManager-v${{inputs.versionMajor}}.${{inputs.versionMinor}}.${{inputs.versionPatch}}-${{steps.build-number.outputs.current_build_number}}-${{inputs.workflowPreset}}.zip
Loading

0 comments on commit 1316224

Please sign in to comment.