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
29 changes: 25 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ name: CI

on:
push:
branches: [master]
pull_request:

# A newer push to the same branch or PR supersedes the running check.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always

Expand All @@ -16,7 +22,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
Expand All @@ -26,6 +32,21 @@ jobs:
sudo apt-get update
sudo apt-get install -y libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev
- uses: Swatinem/rust-cache@v2
- run: cargo build --workspace --release
- run: cargo test --workspace
- run: cargo clippy --workspace --all-targets -- -D warnings
- run: cargo build --workspace --release --locked
- run: cargo test --workspace --locked
- run: cargo clippy --workspace --all-targets --locked -- -D warnings

scripts:
name: install scripts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: shellcheck install.sh
run: shellcheck install.sh
- name: PSScriptAnalyzer install.ps1
shell: pwsh
run: |
# Write-Host is the right tool for an installer piped into iex.
$issues = Invoke-ScriptAnalyzer -Path install.ps1 -Severity Warning,Error -ExcludeRule PSAvoidUsingWriteHost
$issues | Format-Table -AutoSize
if ($issues) { exit 1 }
178 changes: 178 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
name: Release

# Pushing a tag vX.Y.Z (matching the version in Cargo.toml) builds bench51
# for every target, publishes a GitHub release with the archives, checksums
# and the CHANGELOG.md section as notes, then installs it with the one-line
# installers on each OS. Pull requests that touch the release machinery get
# a dry run: everything except publishing.

on:
push:
tags: ['v*']
pull_request:
paths:
- .github/workflows/release.yml
- install.sh
- install.ps1
workflow_dispatch:

permissions:
contents: read

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
include:
# 22.04 keeps the glibc requirement low for older distributions.
- { target: x86_64-unknown-linux-gnu, os: ubuntu-22.04 }
- { target: aarch64-unknown-linux-gnu, os: ubuntu-22.04-arm }
- { target: x86_64-pc-windows-msvc, os: windows-latest }
- { target: aarch64-apple-darwin, os: macos-latest }
# Cross-compiled on Apple silicon, so it can't be run here.
- { target: x86_64-apple-darwin, os: macos-latest, cross: true }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7

- name: Check the tag matches Cargo.toml
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: |
version=$(sed -n 's/^version = "\(.*\)"$/\1/p' Cargo.toml | head -n 1)
if [ "$GITHUB_REF_NAME" != "v$version" ]; then
echo "::error::tag $GITHUB_REF_NAME does not match version $version in Cargo.toml"
exit 1
fi

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

- name: Install Linux GUI dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev

- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}

- name: Build
run: cargo build --release --locked --target ${{ matrix.target }} -p bench51 -p bench51-gui

- name: Package
shell: bash
run: |
name=bench51-${{ matrix.target }}
ext=
if [ "$RUNNER_OS" = Windows ]; then ext=.exe; fi
mkdir -p "dist/$name"
cp "target/${{ matrix.target }}/release/bench51$ext" "target/${{ matrix.target }}/release/bench51-gui$ext" "dist/$name/"
cp README.md LICENSE CHANGELOG.md "dist/$name/"
if [ "$RUNNER_OS" = Linux ]; then
mkdir -p "dist/$name/share/applications" "dist/$name/share/icons/hicolor/scalable/apps"
cp crates/bench51-gui/assets/bench51-gui.desktop "dist/$name/share/applications/"
cp crates/bench51-gui/assets/bench51-gui.svg "dist/$name/share/icons/hicolor/scalable/apps/"
fi
cd dist
if [ "$RUNNER_OS" = Windows ]; then
7z a -tzip "$name.zip" "$name" > /dev/null
else
tar -czf "$name.tar.gz" "$name"
fi
rm -rf "$name"
ls -l

- name: Install the archive and run it
if: runner.os != 'Windows' && !matrix.cross
shell: bash
run: |
sh install.sh --archive "dist/bench51-${{ matrix.target }}.tar.gz" --dir "$RUNNER_TEMP/bin" --no-desktop
"$RUNNER_TEMP/bin/bench51-gui" --version
printf 'ORG 0\nloop: MOV A,#1\n SJMP loop\n END\n' > "$RUNNER_TEMP/t.asm"
"$RUNNER_TEMP/bin/bench51" --assemble "$RUNNER_TEMP/t.asm"
test -s "$RUNNER_TEMP/t.hex"

- name: Install the archive and run it
if: runner.os == 'Windows'
shell: pwsh
run: |
./install.ps1 -Archive "dist/bench51-${{ matrix.target }}.zip" -InstallDir "$env:RUNNER_TEMP\bench51" -NoShortcut
if ($LASTEXITCODE) { exit $LASTEXITCODE }
# The GUI has no console; check its exit code instead of its output.
$gui = Start-Process -FilePath "$env:RUNNER_TEMP\bench51\bench51-gui.exe" -ArgumentList '--version' -Wait -PassThru
if ($gui.ExitCode -ne 0) { exit 1 }

- uses: actions/upload-artifact@v7
with:
name: bench51-${{ matrix.target }}
path: dist/*
if-no-files-found: error

publish:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v7

- uses: actions/download-artifact@v8
with:
path: dist
merge-multiple: true

- name: Checksums
run: |
cd dist
sha256sum -- * > SHA256SUMS
cat SHA256SUMS

- name: Release notes from CHANGELOG.md
run: |
version=${GITHUB_REF_NAME#v}
awk -v v="$version" '/^## \[/ { if (on) exit; on = index($0, "[" v "]") } on' CHANGELOG.md | tail -n +2 > notes.md
if [ ! -s notes.md ]; then
echo "::error::CHANGELOG.md has no section for $version"
exit 1
fi
cat notes.md

- name: Publish
env:
GH_TOKEN: ${{ github.token }}
run: gh release create "$GITHUB_REF_NAME" dist/* --verify-tag --title "bench51 $GITHUB_REF_NAME" --notes-file notes.md

# Installs the published release exactly as the README tells people to.
verify:
name: install on ${{ matrix.os }}
needs: publish
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: One-line install
if: runner.os != 'Windows'
run: |
curl -fsSL "https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$GITHUB_REF_NAME/install.sh" | sh
"$HOME/.local/bin/bench51" --version | grep -F "${GITHUB_REF_NAME#v}"
"$HOME/.local/bin/bench51-gui" --version | grep -F "${GITHUB_REF_NAME#v}"

- name: One-line install
if: runner.os == 'Windows'
shell: pwsh
run: |
irm "https://raw.githubusercontent.com/$env:GITHUB_REPOSITORY/$env:GITHUB_REF_NAME/install.ps1" | iex
$version = & "$env:LOCALAPPDATA\Programs\bench51\bench51.exe" --version
if ($version -notmatch [regex]::Escape($env:GITHUB_REF_NAME.TrimStart('v'))) { exit 1 }
if (-not (Test-Path "$([Environment]::GetFolderPath('Programs'))\bench51.lnk")) { exit 1 }
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Changelog

All notable changes to bench51. The format follows
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and versions follow
[Semantic Versioning](https://semver.org/).

## [0.2.0] - 2026-11-01

### Added

- **bench51-gui**, a desktop IDE laid out like Keil µVision: menus, toolbar,
Project window, editor with breakpoint and error gutter, Build Output, and
in a debug session the Registers, Disassembly, Memory, Symbols, UART #1,
Ports, Timers and Interrupts windows. Windows dock and tab anywhere; the
edit and debug layouts are remembered separately.
- Monochrome, dot-matrix design in dark and light themes (follows the
system by default), with Space Grotesk, Space Mono and Doto bundled.
- µVision's keys (F7, Ctrl-F5, F5, F10/F11, Ctrl-F10/F11, F9) with the
TUI's as aliases; find (Ctrl-F); inline memory editing; clickable SFR
bits and port pins; drag-and-drop to open files.
- Prebuilt releases for Linux (x86_64, aarch64), Windows (x86_64) and macOS
(Apple silicon, Intel), with one-line installers: `install.sh` for Linux
and macOS, `install.ps1` for Windows.
- CI on Linux, Windows and macOS.

### Changed

- The assembler, simulator and debugger session moved into a shared
`bench51-core` crate used by both front ends. The terminal app behaves
as before.
- Unsafe code is forbidden across the workspace.

## [0.1.0] - 2026-10-23

### Added

- `bench51`, a terminal (TUI) 8051 IDE: editor, two-pass assembler for the
full instruction set with Keil-style listing and Intel HEX output,
simulator with timers, interrupts, UART and ports, and a debugger with
breakpoints, stepping and memory poke.
- Headless assembly with `bench51 --assemble`.
- Opening Intel HEX files as disassembled, re-assemblable source.

[0.2.0]: https://github.com/krolyxon/bench51/releases/tag/v0.2.0
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
members = ["crates/*"]

[workspace.package]
version = "0.1.0"
version = "0.2.0"
edition = "2024"

[workspace.lints.rust]
Expand Down
Loading
Loading