Enable log rotation with timestamp context. #383
Workflow file for this run
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
name: Build Workflow | |
on: [ push, pull_request ] | |
jobs: | |
build: | |
name: Build (${{ matrix.config }}) | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
config: [ Debug, RelWithDebInfo ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Create environment variables | |
run: | | |
$commitSha = (git rev-parse --short $env:GITHUB_SHA) | |
echo "RED4EXT_COMMIT_SHA=${commitSha}" | Out-File -FilePath $env:GITHUB_ENV -Encoding UTF8 -Append | |
# CMake is building PDB files for release artifacts using "RelWithDebInfo" config. | |
# Create a "pretty" name for this to make it easier to refer users to this CI artifact in case a bug needs | |
# testing. | |
$config = "${{ matrix.config }}" | |
if ($config -eq "RelWithDebInfo") { | |
$config = "release" | |
} | |
else { | |
$config = $config.ToLower() | |
} | |
echo "RED4EXT_PRETTY_CONFIG=${config}" | Out-File -FilePath $env:GITHUB_ENV -Encoding UTF8 -Append | |
- name: Create build directory | |
run: mkdir build | |
- name: Configure | |
working-directory: build | |
run: | | |
cmake ` | |
-DRED4EXT_EXTRA_WARNINGS=ON ` | |
-DRED4EXT_TREAT_WARNINGS_AS_ERRORS=ON ` | |
${{ github.workspace }} | |
- name: Build | |
working-directory: build | |
run: | | |
cmake ` | |
--build . ` | |
--config ${{ matrix.config }} | |
- name: Prepare ZIP | |
working-directory: build | |
run: | | |
$packagingDir = "./_packaging" | |
# Create the necessary directories. | |
New-Item -ItemType directory -Path $packagingDir | |
New-Item -ItemType directory -Path $packagingDir/bin/x64 | |
New-Item -ItemType directory -Path $packagingDir/red4ext | |
New-Item -ItemType directory -Path $packagingDir/red4ext/plugins | |
# Copy the build artifacts. | |
Copy-Item -Path ./${{ matrix.config }}/bin/winmm.dll -Destination $packagingDir/bin/x64 | |
Copy-Item -Path ./${{ matrix.config }}/bin/RED4ext.dll -Destination $packagingDir/red4ext | |
# Copy the license and third-party licenses. | |
Copy-Item -Path ../LICENSE.md -Destination $packagingDir/red4ext/LICENSE.txt | |
Copy-Item -Path ../THIRD_PARTY_LICENSES.md -Destination $packagingDir/red4ext/THIRD_PARTY_LICENSES.txt | |
- name: Prepare ZIP (PDBs) | |
working-directory: build | |
run: | | |
$packagingDir = "./_packaging_pdbs" | |
# Create the necessary directories. | |
New-Item -ItemType directory -Path $packagingDir | |
New-Item -ItemType directory -Path $packagingDir/bin/x64 | |
New-Item -ItemType directory -Path $packagingDir/red4ext | |
# Copy the PDBs. | |
Copy-Item -Path ./${{ matrix.config }}/bin/winmm.pdb -Destination $packagingDir/bin/x64 | |
Copy-Item -Path ./${{ matrix.config }}/bin/RED4ext.pdb -Destination $packagingDir/red4ext | |
- name: Upload ZIP | |
uses: actions/upload-artifact@v3 | |
with: | |
name: red4ext_${{ env.RED4EXT_PRETTY_CONFIG }}_${{ env.RED4EXT_COMMIT_SHA }} | |
path: build/_packaging/ | |
- name: Upload ZIP (PDBs) | |
uses: actions/upload-artifact@v3 | |
with: | |
name: red4ext_${{ env.RED4EXT_PRETTY_CONFIG }}_${{ env.RED4EXT_COMMIT_SHA }}_pdbs | |
path: build/_packaging_pdbs/ |