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
15 changes: 13 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
with:
components: rustfmt
- run: cargo fmt --all -- --check
- run: sh -n scripts/run-owned-pty-empty.sh
- run: sh -n scripts/run-diabolical-docker.sh
- run: for script in scripts/*.sh; do bash -n "$script"; done
- run: python3 -m py_compile scripts/*.py

lint:
name: Clippy
Expand All @@ -45,6 +45,17 @@ jobs:
- run: cargo build --all-targets --all-features
- run: cargo test --all-targets --all-features

release-package:
name: Release Package Gate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@1.88.0
with:
components: clippy
- run: make release-tooling-test
- run: make release-check

test:
name: Test (${{ matrix.target }})
strategy:
Expand Down
95 changes: 95 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: read

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings

jobs:
validate-version:
name: Validate Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@1.88.0
- name: Guard exact annotated tag and version pack
id: version
run: |
set -euo pipefail
SYSPRIMS_PTY_TAG_GUARD_MODE=post-tag \
SYSPRIMS_PTY_RELEASE_TAG="$GITHUB_REF_NAME" \
./scripts/release-guard-tag-version.sh
version="$(cat VERSION)"
echo "version=${version}" >> "$GITHUB_OUTPUT"

package:
name: Package Gate
runs-on: ubuntu-latest
needs: validate-version
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@1.88.0
with:
components: clippy
- run: make check
- run: make release-check

sbom:
name: Generate SBOM
runs-on: ubuntu-latest
needs: validate-version
container:
image: ghcr.io/fulmenhq/sbom-tools@sha256:3e7de7c2887abd6050c918bdc27cf557a15a00b02a6783c4ba1de716e809bfd4
options: --user 1001
steps:
- uses: actions/checkout@v7
- name: Generate CycloneDX SBOM
run: |
syft dir:. -o cyclonedx-json > "sbom-${{ needs.validate-version.outputs.version }}.cdx.json"
- uses: actions/upload-artifact@v7
with:
name: sbom
path: sbom-${{ needs.validate-version.outputs.version }}.cdx.json

draft-release:
name: Draft GitHub Release
runs-on: ubuntu-latest
needs:
- validate-version
- package
- sbom
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v8
with:
name: sbom
path: release
- name: Stage release provenance assets
run: |
set -euo pipefail
version="${{ needs.validate-version.outputs.version }}"
cp LICENSE-MIT release/
cp "docs/releases/v${version}.md" "release/release-notes-v${version}.md"
find release -maxdepth 1 -type f -print | sort
- name: Create unsigned draft release
uses: softprops/action-gh-release@v2
with:
draft: true
prerelease: false
fail_on_unmatched_files: true
generate_release_notes: false
body_path: release/release-notes-v${{ needs.validate-version.outputs.version }}.md
files: release/*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/dist/
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changelog

All notable changes to `sysprims-pty` are documented here.

## 0.9.0 - 2026-09-01

- First public `sysprims-pty` release.
- Publishes the `sysprims-pty` crate while retaining the `portable_pty`
library target for migration compatibility.
- Uses registry-resolvable `sysprims-session` and `sysprims-timeout` 0.2.3
dependencies.
- Adds release/version/package gates and a draft-only GitHub release workflow.
25 changes: 15 additions & 10 deletions Cargo.lock

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

161 changes: 49 additions & 112 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,135 +1,72 @@
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2018"
rust-version = "1.88.0"
name = "sysprims-pty"
version = "0.9.0"
authors = [
"Wez Furlong",
"3 Leaps, LLC",
]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = true
autobenches = false
authors = ["Wez Furlong", "3 Leaps, LLC"]
edition = "2018"
rust-version = "1.88.0"
repository = "https://github.com/3leaps/sysprims-pty"
homepage = "https://github.com/3leaps/sysprims-pty"
description = "Cross-platform PTY interface with sysprims containment"
documentation = "https://docs.rs/sysprims-pty"
readme = "README.md"
exclude = ["Cargo.toml.orig"]
license = "MIT"
repository = "https://github.com/3leaps/sysprims-pty"
keywords = ["pty", "terminal", "conpty", "process", "containment"]
categories = ["command-line-interface", "development-tools", "os"]
include = [
"Cargo.toml",
"Cargo.lock",
"VERSION",
"README.md",
"UPSTREAM.md",
"LICENSE-MIT",
"CHANGELOG.md",
"RELEASE_NOTES.md",
"docs/releases/v0.9.0.md",
"src/**/*.rs",
"tests/**/*.rs",
"examples/**/*.rs",
]
publish = true
resolver = "2"

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

[[example]]
name = "bash"
path = "examples/bash.rs"

[[example]]
name = "narrow"
path = "examples/narrow.rs"

[[example]]
name = "whoami"
path = "examples/whoami.rs"

[[example]]
name = "whoami_async"
path = "examples/whoami_async.rs"

[dependencies.anyhow]
version = "1.0"

[dependencies.downcast-rs]
version = "1.0"

[dependencies.filedescriptor]
version = "0.8.3"

[dependencies.libc]
version = "0.2"

[dependencies.log]
version = "0.4"

[dependencies.nix]
version = "0.28"
features = [
"term",
"fs",
]

[dependencies.serde]
version = "1.0"
optional = true

[dependencies.serde_derive]
version = "1.0"
optional = true

[dependencies.serial2]
version = "0.2"

[dependencies.shell-words]
version = "1.1"

[dependencies.sysprims-timeout]
git = "https://github.com/3leaps/sysprims"
tag = "v0.2.2"
version = "=0.2.2"

[dev-dependencies.futures]
version = "0.3"

[dev-dependencies.smol]
version = "2.0"

[features]
default = []
serde_support = [
"serde",
"serde_derive",
]

[target."cfg(windows)".dependencies.bitflags]
version = "1.3"

[target."cfg(windows)".dependencies.lazy_static]
version = "1.4"

[target."cfg(windows)".dependencies.shared_library]
version = "0.1"

[target."cfg(windows)".dependencies.winapi]
version = "0.3"
features = [
serde_support = ["serde", "serde_derive"]

[dependencies]
anyhow = "1.0"
downcast-rs = "1.0"
filedescriptor = "0.8.3"
log = "0.4"
libc = "0.2"
nix = { version = "0.28", features = ["term", "fs"] }
shell-words = "1.1"
serde_derive = { version = "1.0", optional = true }
serde = { version = "1.0", optional = true }
serial2 = "0.2"
sysprims-timeout = "=0.2.3"

[target."cfg(windows)".dependencies]
bitflags = "1.3"
lazy_static = "1.4"
shared_library = "0.1"
winapi = { version = "0.3", features = [
"winuser",
"consoleapi",
"handleapi",
"fileapi",
"namedpipeapi",
"synchapi",
]

[target."cfg(windows)".dependencies.winreg]
version = "0.10"
]}
winreg = "0.10"

[target."cfg(unix)".dependencies.sysprims-session]
git = "https://github.com/3leaps/sysprims"
tag = "v0.2.2"
version = "=0.2.2"
version = "=0.2.3"

[dev-dependencies]
smol = "2.0"
futures = "0.3"
Loading