Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 138 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
name: Build Noviq for All Platforms

on:
push:
branches: [ main, Rust-reimpl ]
pull_request:
branches: [ main, Rust-reimpl ]
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: noviq
asset_extension: ''
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: noviq.exe
asset_extension: .exe
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: noviq
asset_extension: ''
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: noviq
asset_extension: ''

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-index-

- name: Cache target directory
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-${{ matrix.target }}-target-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.target }}-target-

- name: Build snapshot (optimized)
run: |
cargo build --profile snapshot --target ${{ matrix.target }}
env:
SNAPSHOT: 1

- name: Get version
id: version
shell: bash
run: |
if [ "${{ runner.os }}" = "Windows" ]; then
VERSION=$(./target/${{ matrix.target }}/snapshot/noviq.exe | grep "Version:" | awk '{print $2}')
else
VERSION=$(./target/${{ matrix.target }}/snapshot/noviq | grep "Version:" | awk '{print $2}')
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"

- name: Prepare artifact name
id: artifact
shell: bash
run: |
OS_NAME="${{ runner.os }}"
OS_LOWER=$(echo "$OS_NAME" | tr '[:upper:]' '[:lower:]')
TARGET="${{ matrix.target }}"
ARCH=$(echo "$TARGET" | cut -d'-' -f1)
VERSION="${{ steps.version.outputs.version }}"
ARTIFACT_NAME="noviq-${VERSION}-${OS_LOWER}-${ARCH}${{ matrix.asset_extension }}"
echo "name=$ARTIFACT_NAME" >> $GITHUB_OUTPUT
echo "Artifact name: $ARTIFACT_NAME"

- name: Rename and prepare artifact
shell: bash
run: |
mkdir -p artifacts
cp target/${{ matrix.target }}/snapshot/${{ matrix.artifact_name }} artifacts/${{ steps.artifact.outputs.name }}

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact.outputs.name }}
path: artifacts/${{ steps.artifact.outputs.name }}
if-no-files-found: error

- name: Display artifact info
shell: bash
run: |
ls -lh artifacts/
file artifacts/${{ steps.artifact.outputs.name }} || true

release:
name: Create Release
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/Rust-reimpl')

steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Display downloaded artifacts
run: |
ls -R artifacts/

- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
67 changes: 0 additions & 67 deletions .github/workflows/gcc-compile.yml

This file was deleted.

19 changes: 16 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
# Rust build artifacts
/target/
Cargo.lock

# Build outputs
/libs/

# IDE files
.idea/
.vscode/
*.swp
*.swo
*~

# OS files
.DS_Store
/.vscode
noviq
noviq.exe
Thumbs.db
46 changes: 0 additions & 46 deletions CMakeLists.txt

This file was deleted.

28 changes: 28 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[package]
name = "noviq"
version = "0.1.0"
edition = "2021"
authors = ["Noviq Contributors"]
description = "A simple, interpreted programming language written in Rust"
license = "GPL-3.0"

[dependencies]
chrono = "0.4"

[lib]
name = "noviq"
path = "src/lib.rs"

[[bin]]
name = "noviq"
path = "src/main.rs"

[profile.release]
opt-level = 3 # Maximum optimization
lto = true # Link-time optimization
codegen-units = 1 # Better optimization, slower compile
panic = "abort" # Smaller binary, no unwinding
strip = true # Strip symbols from binary

[profile.snapshot]
inherits = "release" # Inherits all optimizations from release
Loading