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
87 changes: 87 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: "Crate version to publish (e.g., 0.2.0)"
required: true
type: string
dry_run:
description: "Run cargo publish --dry-run only"
required: false
default: false
type: boolean

env:
CARGO_TERM_COLOR: always

jobs:
release:
name: Publish
runs-on: ubuntu-latest
environment:
name: release
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure Git
run: |
git config --global user.name "movable-ref release bot"
git config --global user.email "actions@github.com"

- name: Install Rust (stable)
uses: dtolnay/rust-toolchain@stable
with:
components: cargo

- name: Verify working tree is clean
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Working tree is not clean" >&2
git status --short >&2
exit 1
fi

- name: Validate version input
run: |
expected="${{ inputs.version }}"
actual=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
if [ "$expected" != "$actual" ]; then
echo "Input version $expected does not match Cargo.toml version $actual" >&2
exit 1
fi

- name: Tests
run: |
cargo test
cargo clippy --all-targets -- -D warnings

- name: Cargo publish (dry-run)
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish --dry-run

- name: Cargo publish
if: ${{ !inputs.dry_run }}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish

- name: Create tag
if: ${{ !inputs.dry_run }}
run: |
git tag v${{ inputs.version }}
git push origin v${{ inputs.version }}

- name: Create GitHub release
if: ${{ !inputs.dry_run }}
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ inputs.version }}
name: v${{ inputs.version }}
body_path: RELEASE_NOTES.md
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.0] - 2025-09-25

### Added
- Optional `debug-guards` feature flag that enables runtime assertions for
relative pointer integrity without impacting release builds.
- Added `SelfRefCell::try_get` / `try_get_mut` for safe readiness checks without
invoking unchecked pointer reconstruction.
- Documentation for Miri and AddressSanitizer workflows, including explicit
failure modes and nightly command snippets.
- `SelfRefCell::try_get` and `SelfRefCell::try_get_mut` so callers can detect
uninitialised state without triggering undefined behaviour.
- Miri support for testing self-referential data structures.

### Changed
- `SelfRef` equality now compares offset and metadata rather than struct
addresses, aligning behaviour with user expectations.
- Debug assertions now validate absolute pointers only when explicitly
requested via `from_parts_with_target`, ensuring regular builds stay lean.

### Fixed
- Guard handling during mutable access ensures pointers are re-sealed on drop,
preventing accidental reuse of stale offsets after interior mutation.

## [0.1.0] - 2025-06-25

### Added
- Initial public release with `SelfRef`, `SelfRefCell`, metadata support for
sized and unsized types, and Criterion benchmarks.

[0.1.0]: https://github.com/engali94/movable-ref/releases/tag/v0.1.0
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ edition = "2021"
default = ["std"]
std = []
nightly = []
debug-guards = []

[dev-dependencies]
criterion = { version = "0.6", features = ["html_reports"] }
Expand Down
Loading
Loading