Compare commits

...

20 Commits

Author SHA1 Message Date
William Bell
f3630fa35a add tag to build name 2025-12-01 03:42:36 +00:00
William Bell
8561f6d762 test 2025-12-01 03:40:00 +00:00
William Bell
1e21a7f11c fix tagging 2025-12-01 03:33:07 +00:00
William Bell
01c89f082c tag creation test 2025-12-01 03:23:06 +00:00
William Bell
b7bfbf5596 test tag 2025-12-01 02:52:09 +00:00
William Bell
725413ed83 test 2025-12-01 02:50:13 +00:00
William Bell
5c3e25d97c test tag 2025-12-01 02:44:38 +00:00
William Bell
d7f5e4744b fix jenkins 2025-12-01 02:43:03 +00:00
William Bell
12cef9103c test 2025-12-01 02:38:18 +00:00
William Bell
21bfc71250 test stable build 2025-12-01 02:33:13 +00:00
William Bell
06da01c119 fix syntax error 2025-12-01 02:25:31 +00:00
William Bell
5741fb4185 change Archive Build Artifacts 2025-12-01 02:22:44 +00:00
William Bell
7d272a2f4d make dev build unstable 2025-12-01 02:13:32 +00:00
William Bell
34a083a2a2 remove github actions and add unstable and dev channels to jenkins 2025-12-01 02:10:59 +00:00
William Bell
eb38da212d change to build for workflows 2025-12-01 02:03:57 +00:00
William Bell
72eca4a15f fix null + 1 causing seg fault 2025-12-01 01:35:20 +00:00
William Bell
66c0db52e8 modify interactive mode license 2025-11-30 06:30:55 +00:00
William Bell
c94e8a227d modify shell license notice 2025-11-30 06:27:47 +00:00
William Bell
4bba257728 test 2025-11-30 06:04:47 +00:00
William Bell
f5ccb2368c change tarball name 2025-11-30 05:58:07 +00:00
5 changed files with 153 additions and 309 deletions

View File

@@ -1,238 +0,0 @@
# SPDX-FileCopyrightText: 2025 William Bell
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: Build and Release
on:
push:
tags:
- '*' # Any tag
jobs:
build-linux-x86_64:
runs-on: ubuntu-latest # build both architectures
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install build tools
run: sudo apt-get update && sudo apt-get install -y 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: linux-x86_64-artifact
path: ${{ env.TAR_NAME }}
build-linux-arm64:
runs-on: ubuntu-22.04-arm # build both architectures
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install build tools
run: sudo apt-get update && sudo apt-get install -y 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: linux-arm64-artifact
path: ${{ env.TAR_NAME }}
build-macos:
runs-on: macos-latest
strategy:
matrix:
arch: [x86_64, arm64] # build both architectures
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
if [ "${{ matrix.arch }}" = "x86_64" ] && [ "$(uname -m)" = "arm64" ]; then
arch -x86_64 conan profile detect
else
conan profile detect
fi
- name: Build
run: |
BUILD_DIR="build_${{ matrix.arch }}"
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
# Use Rosetta for x86_64 builds on Apple Silicon
if [ "${{ matrix.arch }}" = "x86_64" ] && [ "$(uname -m)" = "arm64" ]; then
arch -x86_64 bash -c "
export CMAKE_OSX_ARCHITECTURES=x86_64
conan install .. --build=missing
conan build ..
"
else
export CMAKE_OSX_ARCHITECTURES="${{ matrix.arch }}"
conan install .. --build=missing
conan build ..
fi
cd ..
- name: Package
run: |
TAG=${GITHUB_REF##refs/tags/}
OS="macos"
ARCH="${{ matrix.arch }}"
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-${{ matrix.arch }}-artifact
path: ${{ env.TAR_NAME }}
build-windows:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >
base-devel
mingw-w64-x86_64-gcc
mingw-w64-x86_64-make
mingw-w64-x86_64-cmake
mingw-w64-x86_64-python
mingw-w64-x86_64-python-pip
msys/flex
- name: Install Conan
run: |
python -m pip install --upgrade pip
pip install conan
conan profile detect
- name: Build Project
run: |
conan install . --profile windows-profile.txt --build=missing
conan build . --profile windows-profile.txt
- name: Package
run: |
TAG=${GITHUB_REF##refs/tags/}
OS="windows"
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: windows-artifact
path: ${{ env.TAR_NAME }}
release:
runs-on: ubuntu-latest
needs: [build-linux-x86_64, build-linux-arm64, build-macos, build-windows]
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
merge-multiple: true
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
body: Automated release based on tag ${{ github.ref_name }}
draft: false
prerelease: ${{ startsWith(github.ref_name, 'prerelease-') }}
artifacts: "./artifacts/*"

94
Jenkinsfile vendored
View File

@@ -1,20 +1,63 @@
pipeline {
agent any
environment {
GITEA_URL = 'https://git.wbell.dev'
GITEA_REPO = 'Open-Argon/Chloride'
}
stages {
stage('Checkout') {
steps {
script {
// Detect if this is a tag build via Jenkins-supplied vars
if (env.GIT_TAG) {
echo "Checking out tag: ${env.GIT_TAG}"
checkout([
$class: 'GitSCM',
branches: [[name: "refs/tags/${env.GIT_TAG}"]],
userRemoteConfigs: [[url: scm.userRemoteConfigs[0].url]],
doGenerateSubmoduleConfigurations: false,
extensions: [
[$class: 'SubmoduleUpdate', recursiveSubmodules: true]
]
])
} else {
echo "Checking out normal branch"
checkout scm
}
// update submodules
sh 'git submodule update --init --recursive'
}
}
}
stage('Detect Tag') {
steps {
script {
def tag = sh(script: "git describe --tags --exact-match", returnStdout: true).trim()
echo "Tag detected: ${tag}"
if (tag.toLowerCase().contains('unsable')) {
echo "Tag contains 'unsable' → marking build UNSTABLE"
currentBuild.result = 'UNSTABLE'
}
// Expose for other stages
currentBuild.displayName = "#${env.BUILD_NUMBER} ${tag}"
env.TAG_NAME = tag
}
}
}
stage('Setup Conan') {
steps {
sh '''
python3 -m venv /tmp/venv
. /tmp/venv/bin/activate
apt update
apt install -y cmake flex python3 python3-pip python3-venv
python3 -m venv /tmp/venv
. /tmp/venv/bin/activate
pip install --upgrade pip
pip install conan
'''
@@ -25,9 +68,8 @@ pipeline {
steps {
sh '''
. /tmp/venv/bin/activate
if [ ! -f ~/.conan2/profiles/default ]; then
rm -rf ~/.conan2
conan profile detect
fi
'''
}
}
@@ -50,17 +92,51 @@ pipeline {
}
}
stage('Archive Build Artifacts') {
steps {
script {
// Determine platform
def os = sh(returnStdout: true, script: 'uname -s').trim().toLowerCase()
def arch = sh(returnStdout: true, script: 'uname -m').trim().toLowerCase()
// Determine version (tag or "dev")
def version = env.TAG_NAME ?: "dev"
// Construct file name
env.OUTPUT_FILE = "chloride-${version}-${os}-${arch}.tar.gz"
echo "Packaging as: ${env.OUTPUT_FILE}"
}
sh '''
# Copy LICENSE.txt into build/bin
# Ensure LICENSE.txt is in the output directory
cp LICENSE.txt build/bin/
# Create tarball with the contents of build/bin at the root
tar -czf chloride.tar.gz -C build/bin .
# Create tarball with auto-generated name
tar -czf "$OUTPUT_FILE" -C build/bin .
'''
// Archive the tarball
archiveArtifacts artifacts: 'chloride.tar.gz', allowEmptyArchive: false
archiveArtifacts artifacts: "${env.OUTPUT_FILE}", allowEmptyArchive: false
}
}
}
post {
always {
script {
// Automatically detects full ref name
def tag = sh(script: "git describe --tags --exact-match", returnStdout: true).trim()
echo "Detected tag: ${tag}"
if (tag.toLowerCase().contains("unstable")) {
echo "Unstable tag detected"
currentBuild.result = "UNSTABLE"
} else {
echo "Stable tagged build"
currentBuild.description = "Stable"
currentBuild.result = "SUCCESS"
}
}
}
}

View File

@@ -100,12 +100,13 @@ ArgonObject *ARGON_ADDITION_FUNCTION(size_t argc, ArgonObject **argv,
}
ArgonObject *output = argv[0];
for (size_t i = 1; i < argc; i++) {
ArgonObject *object_class = get_builtin_field(output, __class__);
ArgonObject *object__add__ = get_builtin_field_for_class(
get_builtin_field(output, __class__), __add__, output);
object_class, __add__, output);
if (!object__add__) {
ArgonObject *cls___name__ = get_builtin_field(output, __name__);
ArgonObject *cls___name__ = get_builtin_field(object_class, __name__);
*err = create_err(0, 0, 0, "", "Runtime Error",
"Object '%.*s' is missing __add__ method",
"Object of type '%.*s' is missing __add__ method",
(int)cls___name__->value.as_str->length,
cls___name__->value.as_str->data);
return ARGON_NULL;
@@ -126,12 +127,13 @@ ArgonObject *ARGON_SUBTRACTION_FUNCTION(size_t argc, ArgonObject **argv,
}
ArgonObject *output = argv[0];
for (size_t i = 1; i < argc; i++) {
ArgonObject *object_class = get_builtin_field(output, __class__);
ArgonObject *function__subtract__ = get_builtin_field_for_class(
get_builtin_field(output, __class__), __subtract__, output);
object_class, __subtract__, output);
if (!function__subtract__) {
ArgonObject *cls___name__ = get_builtin_field(output, __name__);
ArgonObject *cls___name__ = get_builtin_field(object_class, __name__);
*err = create_err(0, 0, 0, "", "Runtime Error",
"Object '%.*s' is missing __subtract__ method",
"Object of type '%.*s' is missing __subtract__ method",
(int)cls___name__->value.as_str->length,
cls___name__->value.as_str->data);
return ARGON_NULL;
@@ -152,12 +154,13 @@ ArgonObject *ARGON_MULTIPLY_FUNCTION(size_t argc, ArgonObject **argv,
}
ArgonObject *output = argv[0];
for (size_t i = 1; i < argc; i++) {
ArgonObject *object_class = get_builtin_field(output, __class__);
ArgonObject *function__multiply__ = get_builtin_field_for_class(
get_builtin_field(output, __class__), __multiply__, output);
object_class, __multiply__, output);
if (!function__multiply__) {
ArgonObject *cls___name__ = get_builtin_field(output, __name__);
ArgonObject *cls___name__ = get_builtin_field(object_class, __name__);
*err = create_err(0, 0, 0, "", "Runtime Error",
"Object '%.*s' is missing __multiply__ method",
"Object of type '%.*s' is missing __multiply__ method",
(int)cls___name__->value.as_str->length,
cls___name__->value.as_str->data);
return ARGON_NULL;
@@ -177,12 +180,13 @@ ArgonObject *ARGON_DIVIDE_FUNCTION(size_t argc, ArgonObject **argv, ArErr *err,
}
ArgonObject *output = argv[0];
for (size_t i = 1; i < argc; i++) {
ArgonObject *object_class = get_builtin_field(output, __class__);
ArgonObject *function___divide__ = get_builtin_field_for_class(
get_builtin_field(output, __class__), __divide__, output);
object_class, __divide__, output);
if (!function___divide__) {
ArgonObject *cls___name__ = get_builtin_field(output, __name__);
ArgonObject *cls___name__ = get_builtin_field(object_class, __name__);
*err = create_err(0, 0, 0, "", "Runtime Error",
"Object '%.*s' is missing __divide__ method",
"Object of type '%.*s' is missing __divide__ method",
(int)cls___name__->value.as_str->length,
cls___name__->value.as_str->data);
return ARGON_NULL;

View File

@@ -230,8 +230,9 @@ int shell() {
signal(SIGINT, handle_sigint);
printf("Argon (Chloride %s)\nType \"license\" for more information.\n",
version_string);
printf("Chloride %s Copyright (C) 2025 William Bell\n"
"This program comes with ABSOLUTELY NO WARRANTY; for details type `license'.\n"
"This is free software, and you are welcome to redistribute it under certain conditions; type `license' for details.\n", version_string);
ArgonObject *output_object = create_argon_native_function("log", term_log);
char *totranslate = NULL;

1
tests/null_plus_one.ar Normal file
View File

@@ -0,0 +1 @@
null+1