Compare commits
24 Commits
prerelease
...
prerelease
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a81640747d | ||
|
|
4a1ed23f96 | ||
|
|
eb36d02fcb | ||
|
|
7b3a1e1835 | ||
|
|
8e53579682 | ||
|
|
0d8f262185 | ||
|
|
fc6f41d89b | ||
|
|
6a7ce72eb7 | ||
|
|
f84e5429a5 | ||
|
|
f4c7294267 | ||
|
|
be4b04a286 | ||
|
|
9d11122e93 | ||
|
|
241e447da0 | ||
|
|
dd750ab164 | ||
|
|
922b129250 | ||
|
|
c2df9c0e83 | ||
|
|
923503493e | ||
|
|
686cb08f11 | ||
|
|
1cfb4acda6 | ||
|
|
436f30330b | ||
|
|
5381967ed6 | ||
|
|
6f84a4a485 | ||
|
|
4b4b1fa777 | ||
|
|
2b6e785638 |
209
.github/workflows/release.yml
vendored
209
.github/workflows/release.yml
vendored
@@ -1,119 +1,158 @@
|
|||||||
|
# SPDX-FileCopyrightText: 2025 William Bell
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
name: Build and Release
|
name: Build and Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '*' # Trigger on any tag push
|
- '*' # Any tag
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_and_release:
|
build-linux:
|
||||||
strategy:
|
runs-on: ubuntu-latest
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Setup Python (needed for Conan)
|
- name: Install build tools
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y flex bison
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|
||||||
- name: Install Conan (Linux/macOS)
|
- name: Install Conan
|
||||||
if: runner.os != 'Windows'
|
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install conan
|
pip install conan
|
||||||
shell: bash
|
conan profile detect
|
||||||
|
|
||||||
- name: Install Conan (Windows)
|
- name: Build
|
||||||
if: runner.os == 'Windows'
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install conan
|
|
||||||
shell: pwsh
|
|
||||||
|
|
||||||
- name: Configure Conan (Linux/macOS)
|
|
||||||
if: runner.os != 'Windows'
|
|
||||||
run: conan profile detect
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Configure Conan (Windows)
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
run: conan profile detect
|
|
||||||
shell: pwsh
|
|
||||||
|
|
||||||
- name: Install dependencies and build (Linux/macOS)
|
|
||||||
if: runner.os != 'Windows'
|
|
||||||
run: |
|
run: |
|
||||||
conan install . --build=missing
|
conan install . --build=missing
|
||||||
conan build .
|
conan build .
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Install dependencies and build (Windows)
|
- name: Package
|
||||||
if: runner.os == 'Windows'
|
|
||||||
run: |
|
|
||||||
conan install . --build=missing
|
|
||||||
conan build .
|
|
||||||
shell: pwsh
|
|
||||||
|
|
||||||
- name: Determine if prerelease (Linux/macOS)
|
|
||||||
if: runner.os != 'Windows'
|
|
||||||
id: prerelease_check_unix
|
|
||||||
run: |
|
|
||||||
TAG=${GITHUB_REF##refs/tags/}
|
|
||||||
if [[ "$TAG" == prerelease-* ]]; then
|
|
||||||
echo "true" > prerelease.txt
|
|
||||||
else
|
|
||||||
echo "false" > prerelease.txt
|
|
||||||
fi
|
|
||||||
echo "prerelease=$(cat prerelease.txt)" >> $GITHUB_OUTPUT
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Determine if prerelease (Windows)
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
id: prerelease_check_win
|
|
||||||
run: |
|
|
||||||
$TAG = $env:GITHUB_REF -replace 'refs/tags/', ''
|
|
||||||
if ($TAG -like 'prerelease-*') {
|
|
||||||
echo "true" > prerelease.txt
|
|
||||||
} else {
|
|
||||||
echo "false" > prerelease.txt
|
|
||||||
}
|
|
||||||
echo "prerelease=$(Get-Content prerelease.txt)" >> $env:GITHUB_OUTPUT
|
|
||||||
shell: pwsh
|
|
||||||
|
|
||||||
- name: Archive build folder (Linux/macOS)
|
|
||||||
if: runner.os != 'Windows'
|
|
||||||
run: |
|
run: |
|
||||||
TAG=${GITHUB_REF##refs/tags/}
|
TAG=${GITHUB_REF##refs/tags/}
|
||||||
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
FOLDER_NAME="chloride-$TAG-$OS-$ARCH"
|
FOLDER="chloride-$TAG-$OS-$ARCH"
|
||||||
TAR_NAME="$FOLDER_NAME.tar.gz"
|
TAR="$FOLDER.tar.gz"
|
||||||
mv build/bin "$FOLDER_NAME"
|
mv build/bin "$FOLDER"
|
||||||
cp LICENSE "$FOLDER_NAME"
|
cp LICENSE.txt "$FOLDER"
|
||||||
tar -czf "$TAR_NAME" "$FOLDER_NAME"
|
tar -czf "$TAR" "$FOLDER"
|
||||||
echo "TAR_NAME=$TAR_NAME" >> $GITHUB_ENV
|
echo "TAR_NAME=$TAR" >> $GITHUB_ENV
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Archive build folder (Windows)
|
- name: Upload artifact
|
||||||
if: runner.os == 'Windows'
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: linux-artifact
|
||||||
|
path: ${{ env.TAR_NAME }}
|
||||||
|
|
||||||
|
build-macos:
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Install build tools
|
||||||
|
run: brew install flex bison
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.x'
|
||||||
|
|
||||||
|
- name: Install Conan
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install conan
|
||||||
|
conan profile detect
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
conan install . --build=missing
|
||||||
|
conan build .
|
||||||
|
|
||||||
|
- name: Package
|
||||||
|
run: |
|
||||||
|
TAG=${GITHUB_REF##refs/tags/}
|
||||||
|
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||||
|
ARCH=$(uname -m)
|
||||||
|
FOLDER="chloride-$TAG-$OS-$ARCH"
|
||||||
|
TAR="$FOLDER.tar.gz"
|
||||||
|
mv build/bin "$FOLDER"
|
||||||
|
cp LICENSE.txt "$FOLDER"
|
||||||
|
tar -czf "$TAR" "$FOLDER"
|
||||||
|
echo "TAR_NAME=$TAR" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: macos-artifact
|
||||||
|
path: ${{ env.TAR_NAME }}
|
||||||
|
|
||||||
|
build-windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Install build tools
|
||||||
|
run: choco install winflexbison -y
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.x'
|
||||||
|
|
||||||
|
- name: Install Conan
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install conan
|
||||||
|
conan profile detect
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
|
- name: Build with MinGW
|
||||||
|
run: |
|
||||||
|
make
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
|
- name: Package
|
||||||
run: |
|
run: |
|
||||||
$TAG = $env:GITHUB_REF -replace 'refs/tags/', ''
|
$TAG = $env:GITHUB_REF -replace 'refs/tags/', ''
|
||||||
$ARCH = if ([Environment]::Is64BitOperatingSystem) { 'x64' } else { 'x86' }
|
$ARCH = if ([Environment]::Is64BitOperatingSystem) { 'x64' } else { 'x86' }
|
||||||
$FOLDER_NAME = "chloride-$TAG-windows-$ARCH"
|
$FOLDER = "chloride-$TAG-windows-$ARCH"
|
||||||
$TAR_NAME = "$FOLDER_NAME.zip"
|
$ZIP = "$FOLDER.zip"
|
||||||
Rename-Item build\bin $FOLDER_NAME
|
Rename-Item bin $FOLDER
|
||||||
Copy-Item LICENSE $FOLDER_NAME
|
Copy-Item LICENSE.txt $FOLDER
|
||||||
Compress-Archive -Path $FOLDER_NAME -DestinationPath $TAR_NAME
|
Compress-Archive -Path $FOLDER -DestinationPath $ZIP
|
||||||
echo "TAR_NAME=$TAR_NAME" >> $env:GITHUB_ENV
|
echo "TAR_NAME=$ZIP" >> $env:GITHUB_ENV
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: windows-artifact
|
||||||
|
path: ${{ env.TAR_NAME }}
|
||||||
|
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [build-linux, build-macos, build-windows]
|
||||||
|
steps:
|
||||||
|
- name: Download artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: ./artifacts
|
||||||
|
|
||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
@@ -121,5 +160,5 @@ jobs:
|
|||||||
name: Release ${{ github.ref_name }}
|
name: Release ${{ github.ref_name }}
|
||||||
body: Automated release based on tag ${{ github.ref_name }}
|
body: Automated release based on tag ${{ github.ref_name }}
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: ${{ runner.os == 'Windows' && steps.prerelease_check_win.outputs.prerelease || steps.prerelease_check_unix.outputs.prerelease }}
|
prerelease: ${{ startsWith(github.ref_name, 'prerelease-') }}
|
||||||
artifacts: ${{ env.TAR_NAME }}
|
artifacts: "./artifacts/*"
|
||||||
@@ -52,7 +52,9 @@ find_package(BDWgc REQUIRED)
|
|||||||
find_package(gmp REQUIRED)
|
find_package(gmp REQUIRED)
|
||||||
|
|
||||||
target_compile_options(argon PRIVATE -O3 -Wall -Wextra -Wno-unused-function -s)
|
target_compile_options(argon PRIVATE -O3 -Wall -Wextra -Wno-unused-function -s)
|
||||||
target_link_options(argon PRIVATE -static)
|
if(NOT APPLE)
|
||||||
|
target_link_options(argon PRIVATE -static)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(argon PRIVATE
|
target_link_libraries(argon PRIVATE
|
||||||
BDWgc::BDWgc
|
BDWgc::BDWgc
|
||||||
|
|||||||
8
conan/profiles/windows-mingw
Normal file
8
conan/profiles/windows-mingw
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[settings]
|
||||||
|
os=Windows
|
||||||
|
arch=x86_64
|
||||||
|
compiler=gcc
|
||||||
|
compiler.version=13
|
||||||
|
compiler.cppstd=gnu17
|
||||||
|
compiler.libcxx=libstdc++11
|
||||||
|
build_type=Release
|
||||||
20
conanfile.py
20
conanfile.py
@@ -5,6 +5,7 @@
|
|||||||
from conan import ConanFile
|
from conan import ConanFile
|
||||||
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout
|
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout
|
||||||
from shutil import which
|
from shutil import which
|
||||||
|
import os
|
||||||
|
|
||||||
class ArgonConan(ConanFile):
|
class ArgonConan(ConanFile):
|
||||||
name = "argon"
|
name = "argon"
|
||||||
@@ -29,20 +30,19 @@ class ArgonConan(ConanFile):
|
|||||||
self.folders.generators = "build"
|
self.folders.generators = "build"
|
||||||
|
|
||||||
def generate(self):
|
def generate(self):
|
||||||
|
os.environ["CONAN_NON_INTERACTIVE"] = "1"
|
||||||
tc = CMakeToolchain(self)
|
tc = CMakeToolchain(self)
|
||||||
|
|
||||||
# Try to find flex in system PATH first
|
if os.name == "nt": # Windows
|
||||||
flex_path = which("flex")
|
flex_path = which("win_flex") or which("win_flex.exe")
|
||||||
|
|
||||||
# If not found, fallback to flex from Conan build requirements
|
|
||||||
if not flex_path:
|
if not flex_path:
|
||||||
flex_dep = self.dependencies.build.get("flex", None)
|
raise Exception("win_flex not found in PATH. Install winflexbison via choco.")
|
||||||
if not flex_dep:
|
else:
|
||||||
raise Exception("Flex not found in system PATH and not declared as build requirement")
|
flex_path = which("flex")
|
||||||
flex_path = join(flex_dep.package_folder, "bin", "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.variables["FLEX_EXECUTABLE"] = flex_path.replace("\\", "\\\\")
|
||||||
tc.generate()
|
tc.generate()
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user