Compare commits
6 Commits
prerelease
...
prerelease
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
436f30330b | ||
|
|
5381967ed6 | ||
|
|
6f84a4a485 | ||
|
|
4b4b1fa777 | ||
|
|
2b6e785638 | ||
|
|
51e82e5b2e |
25
.github/workflows/release.yml
vendored
25
.github/workflows/release.yml
vendored
@@ -13,6 +13,21 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
# Linux
|
||||
- name: Install build tools (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
run: sudo apt-get update && sudo apt-get install -y flex bison
|
||||
|
||||
# macOS
|
||||
- name: Install build tools (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
run: brew install flex bison
|
||||
|
||||
# Windows
|
||||
- name: Install build tools (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
run: choco install winflexbison -y
|
||||
shell: pwsh
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
@@ -63,7 +78,7 @@ jobs:
|
||||
|
||||
- name: Determine if prerelease (Linux/macOS)
|
||||
if: runner.os != 'Windows'
|
||||
id: prerelease_check
|
||||
id: prerelease_check_unix
|
||||
run: |
|
||||
TAG=${GITHUB_REF##refs/tags/}
|
||||
if [[ "$TAG" == prerelease-* ]]; then
|
||||
@@ -76,7 +91,7 @@ jobs:
|
||||
|
||||
- name: Determine if prerelease (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
id: prerelease_check
|
||||
id: prerelease_check_win
|
||||
run: |
|
||||
$TAG = $env:GITHUB_REF -replace 'refs/tags/', ''
|
||||
if ($TAG -like 'prerelease-*') {
|
||||
@@ -96,7 +111,7 @@ jobs:
|
||||
FOLDER_NAME="chloride-$TAG-$OS-$ARCH"
|
||||
TAR_NAME="$FOLDER_NAME.tar.gz"
|
||||
mv build/bin "$FOLDER_NAME"
|
||||
cp LICENSE "$FOLDER_NAME"
|
||||
cp LICENSE.txt "$FOLDER_NAME"
|
||||
tar -czf "$TAR_NAME" "$FOLDER_NAME"
|
||||
echo "TAR_NAME=$TAR_NAME" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
@@ -109,7 +124,7 @@ jobs:
|
||||
$FOLDER_NAME = "chloride-$TAG-windows-$ARCH"
|
||||
$TAR_NAME = "$FOLDER_NAME.zip"
|
||||
Rename-Item build\bin $FOLDER_NAME
|
||||
Copy-Item LICENSE $FOLDER_NAME
|
||||
Copy-Item LICENSE.txt $FOLDER_NAME
|
||||
Compress-Archive -Path $FOLDER_NAME -DestinationPath $TAR_NAME
|
||||
echo "TAR_NAME=$TAR_NAME" >> $env:GITHUB_ENV
|
||||
shell: pwsh
|
||||
@@ -121,5 +136,5 @@ jobs:
|
||||
name: Release ${{ github.ref_name }}
|
||||
body: Automated release based on tag ${{ github.ref_name }}
|
||||
draft: false
|
||||
prerelease: ${{ steps.prerelease_check.outputs.prerelease }}
|
||||
prerelease: ${{ runner.os == 'Windows' && steps.prerelease_check_win.outputs.prerelease || steps.prerelease_check_unix.outputs.prerelease }}
|
||||
artifacts: ${{ env.TAR_NAME }}
|
||||
19
conanfile.py
19
conanfile.py
@@ -5,6 +5,7 @@
|
||||
from conan import ConanFile
|
||||
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout
|
||||
from shutil import which
|
||||
import os
|
||||
|
||||
class ArgonConan(ConanFile):
|
||||
name = "argon"
|
||||
@@ -31,18 +32,16 @@ class ArgonConan(ConanFile):
|
||||
def generate(self):
|
||||
tc = CMakeToolchain(self)
|
||||
|
||||
# Try to find flex in system PATH first
|
||||
flex_path = which("flex")
|
||||
|
||||
# If not found, fallback to flex from Conan build requirements
|
||||
if not flex_path:
|
||||
flex_dep = self.dependencies.build.get("flex", None)
|
||||
if not flex_dep:
|
||||
raise Exception("Flex not found in system PATH and not declared as build requirement")
|
||||
flex_path = join(flex_dep.package_folder, "bin", "flex")
|
||||
if os.name == "nt": # Windows
|
||||
flex_path = which("win_flex") or which("win_flex.exe")
|
||||
if not flex_path:
|
||||
raise Exception("win_flex not found in PATH. Install winflexbison via choco.")
|
||||
else:
|
||||
flex_path = which("flex")
|
||||
if not flex_path:
|
||||
raise Exception("Flex not found in system PATH. Please install flex on Linux/macOS.")
|
||||
|
||||
tc.variables["FLEX_EXECUTABLE"] = flex_path
|
||||
|
||||
tc.generate()
|
||||
|
||||
def build(self):
|
||||
|
||||
Reference in New Issue
Block a user