mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 16:10:36 +00:00
CMakeLists rejects CLASSICAPI_TAG values that aren't empty or vMAJOR.MINOR.PATCH. Branch pushes were passing `github.ref_name` (= the branch name, e.g. "master") and failing the regex.
52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: ['**']
|
|
tags: ['v*']
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Stamp embedded TOC version
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
shell: pwsh
|
|
run: |
|
|
$version = '${{ github.ref_name }}' -replace '^v',''
|
|
$toc = 'AddOns/!!!ClassicAPI/!!!ClassicAPI.toc'
|
|
(Get-Content $toc) -replace '^## Version:.*', "## Version: $version" |
|
|
Set-Content $toc
|
|
|
|
- name: Configure (tag)
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
run: cmake -B build -A Win32 "-DCLASSICAPI_TAG=${{ github.ref_name }}"
|
|
|
|
- name: Configure (branch)
|
|
if: "!startsWith(github.ref, 'refs/tags/v')"
|
|
run: cmake -B build -A Win32
|
|
|
|
- name: Build
|
|
run: cmake --build build --config Release
|
|
|
|
- name: Upload artifact
|
|
if: "!startsWith(github.ref, 'refs/tags/v')"
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ClassicAPI-${{ github.sha }}
|
|
path: build/Release/ClassicAPI.dll
|
|
|
|
- name: Release
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: build/Release/ClassicAPI.dll
|
|
generate_release_notes: true
|