Compare commits

..

25 Commits

Author SHA1 Message Date
William Bell
4a1ed23f96 fix release.yml 2025-08-15 22:05:57 +01:00
William Bell
eb36d02fcb fix release.yml 2025-08-15 22:03:23 +01:00
William Bell
7b3a1e1835 fix release.yml 2025-08-15 21:52:16 +01:00
William Bell
8e53579682 fix release.yml 2025-08-15 21:36:51 +01:00
William Bell
0d8f262185 this thing is really annoying me now 2025-08-15 21:34:31 +01:00
William Bell
fc6f41d89b fix release.yml 2025-08-15 21:30:01 +01:00
William Bell
6a7ce72eb7 fix cmake 2025-08-15 21:23:08 +01:00
William Bell
f84e5429a5 fix release.yml 2025-08-15 21:16:48 +01:00
William Bell
f4c7294267 fix release.yml 2025-08-15 21:14:17 +01:00
William Bell
be4b04a286 fix release.yml 2025-08-15 20:59:49 +01:00
William Bell
9d11122e93 fix conanfile.py 2025-08-15 20:50:58 +01:00
William Bell
241e447da0 fix release.yml 2025-08-15 20:30:54 +01:00
William Bell
dd750ab164 fix release.yml 2025-08-15 20:26:54 +01:00
William Bell
922b129250 fix release.yml 2025-08-15 20:18:17 +01:00
William Bell
c2df9c0e83 fix release.yml 2025-08-15 20:15:18 +01:00
William Bell
923503493e fix release.yml 2025-08-15 20:04:55 +01:00
William Bell
686cb08f11 fix conan file 2025-08-15 19:56:54 +01:00
William Bell
1cfb4acda6 fix CMakeLists.txt 2025-08-15 19:52:33 +01:00
William Bell
436f30330b fix copying license 2025-08-15 19:45:12 +01:00
William Bell
5381967ed6 fix conanfile 2025-08-15 19:40:41 +01:00
William Bell
6f84a4a485 fix conan file 2025-08-15 19:37:38 +01:00
William Bell
4b4b1fa777 fix release.yml 2025-08-15 19:22:26 +01:00
William Bell
2b6e785638 fix conan file 2025-08-15 19:19:15 +01:00
William Bell
51e82e5b2e fix release.yml 2025-08-15 19:15:28 +01:00
William Bell
2c56810cc4 change release.yml 2025-08-15 19:13:49 +01:00
4 changed files with 154 additions and 72 deletions

View File

@@ -7,22 +7,20 @@ 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'
@@ -31,70 +29,144 @@ jobs:
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install conan pip install conan
shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || 'bash' }} conan profile detect
- name: Configure Conan - name: Build
run: conan profile detect
shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || 'bash' }}
- name: Install dependencies and build with Conan
run: | run: |
conan install . --build=missing conan install . --build=missing
conan build . conan build .
shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || 'bash' }}
- name: Determine if prerelease - name: Package
id: prerelease_check
run: | run: |
TAG=${GITHUB_REF##refs/tags/} TAG=${GITHUB_REF##refs/tags/}
if [[ "$TAG" == prerelease-* ]]; then OS=$(uname -s | tr '[:upper:]' '[:lower:]')
echo "true" > prerelease.txt ARCH=$(uname -m)
else FOLDER="chloride-$TAG-$OS-$ARCH"
echo "false" > prerelease.txt TAR="$FOLDER.tar.gz"
fi mv build/bin "$FOLDER"
echo "prerelease=$(cat prerelease.txt)" >> $GITHUB_OUTPUT cp LICENSE.txt "$FOLDER"
shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || 'bash' }} tar -czf "$TAR" "$FOLDER"
echo "TAR_NAME=$TAR" >> $GITHUB_ENV
- name: Archive build folder - name: Upload artifact
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: | run: |
TAG=${GITHUB_REF##refs/tags/} TAG=${GITHUB_REF##refs/tags/}
if [[ "$RUNNER_OS" == "Linux" ]]; then OS=$(uname -s | tr '[:upper:]' '[:lower:]')
OS=linux ARCH=$(uname -m)
ARCH=$(uname -m) FOLDER="chloride-$TAG-$OS-$ARCH"
FOLDER_NAME="chloride-$TAG-$OS-$ARCH" TAR="$FOLDER.tar.gz"
TAR_NAME="$FOLDER_NAME.tar.gz" mv build/bin "$FOLDER"
mv build/bin "$FOLDER_NAME" cp LICENSE.txt "$FOLDER"
cp LICENSE "$FOLDER_NAME" tar -czf "$TAR" "$FOLDER"
tar -czf "$TAR_NAME" "$FOLDER_NAME" echo "TAR_NAME=$TAR" >> $GITHUB_ENV
elif [[ "$RUNNER_OS" == "macOS" ]]; then
OS=macos - name: Upload artifact
ARCH=$(uname -m) uses: actions/upload-artifact@v4
FOLDER_NAME="chloride-$TAG-$OS-$ARCH" with:
TAR_NAME="$FOLDER_NAME.tar.gz" name: macos-artifact
mv build/bin "$FOLDER_NAME" path: ${{ env.TAR_NAME }}
cp LICENSE "$FOLDER_NAME"
tar -czf "$TAR_NAME" "$FOLDER_NAME" build-windows:
else runs-on: windows-latest
# Windows steps:
$TAG = $env:GITHUB_REF -replace 'refs/tags/', '' - uses: actions/checkout@v3
$ARCH = if ([Environment]::Is64BitOperatingSystem) { 'x64' } else { 'x86' } with:
$FOLDER_NAME = "chloride-$TAG-windows-$ARCH" submodules: recursive
$TAR_NAME = "$FOLDER_NAME.zip"
Rename-Item build\bin $FOLDER_NAME - name: Install MSYS2 and build tools
Copy-Item LICENSE $FOLDER_NAME uses: msys2/setup-msys2@v3
Compress-Archive -Path $FOLDER_NAME -DestinationPath $TAR_NAME with:
fi update: true
echo "TAR_NAME=$TAR_NAME" >> $GITHUB_ENV install: >
shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || 'bash' }} mingw-w64-x86_64-toolchain
mingw-w64-x86_64-gmp
mingw-w64-x86_64-make
mingw-w64-x86_64-flex
mingw-w64-x86_64-bison
shell: msys2 {0}
- 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: msys2 {0}
- name: Package
run: |
$TAG = $env:GITHUB_REF -replace 'refs/tags/', ''
$ARCH = if ([Environment]::Is64BitOperatingSystem) { 'x64' } else { 'x86' }
$FOLDER = "chloride-$TAG-windows-$ARCH"
$ZIP = "$FOLDER.zip"
Rename-Item bin $FOLDER
Copy-Item LICENSE.txt $FOLDER
Compress-Archive -Path $FOLDER -DestinationPath $ZIP
echo "TAR_NAME=$ZIP" >> $env:GITHUB_ENV
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
id: create_release
uses: ncipollo/release-action@v1 uses: ncipollo/release-action@v1
with: with:
tag: ${{ github.ref_name }} tag: ${{ github.ref_name }}
name: Release ${{ github.ref_name }} name: Release ${{ github.ref_name }}
body: | body: Automated release based on tag ${{ github.ref_name }}
Automated release based on tag ${{ github.ref_name }}
draft: false draft: false
prerelease: ${{ steps.prerelease_check.outputs.prerelease }} prerelease: ${{ startsWith(github.ref_name, 'prerelease-') }}
artifacts: ${{ env.TAR_NAME }} artifacts: "./artifacts/*"

View File

@@ -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

View 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

View File

@@ -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 flex_path:
# If not found, fallback to flex from Conan build requirements raise Exception("win_flex not found in PATH. Install winflexbison via choco.")
if not flex_path: else:
flex_dep = self.dependencies.build.get("flex", None) flex_path = which("flex")
if not flex_dep: if not flex_path:
raise Exception("Flex not found in system PATH and not declared as build requirement") raise Exception("Flex not found in system PATH. Please install flex on Linux/macOS.")
flex_path = join(flex_dep.package_folder, "bin", "flex")
tc.variables["FLEX_EXECUTABLE"] = flex_path
tc.variables["FLEX_EXECUTABLE"] = flex_path.replace("\\", "\\\\")
tc.generate() tc.generate()
def build(self): def build(self):