Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b4ea9d6
feat: Split crate into crane_bricks and crane_cli
timothebot Sep 22, 2025
ec72dd9
docs: Add basic mdbook
timothebot Sep 22, 2025
886ff94
style: Apply cargo fmt to all files
timothebot Sep 23, 2025
88b5044
feat: Implement test and functionality for brick without config
timothebot Sep 23, 2025
5cce939
feat: Add more tests for modify_action
timothebot Sep 23, 2025
0428ee2
feat: Add run command action and tests
timothebot Sep 23, 2025
a7dfb9c
feat: Remove location and add prepend type to modify action
timothebot Sep 23, 2025
7546393
docs: Update mdbook to match code
timothebot Sep 23, 2025
a4892cd
feat: Improve logging output to make it more nice to look at
timothebot Sep 25, 2025
e4b66cf
feat: Add aliases, improve general structure, improve docs, update ex…
timothebot Oct 13, 2025
e45f434
ci: Add GitHub workflows
timothebot Oct 13, 2025
7705ee8
chore: Add metadata to packages
timothebot Oct 13, 2025
af194ac
fix: License spelling
timothebot Oct 13, 2025
f311a90
ci: Split release and publish to crates.io into two workflows
timothebot Oct 13, 2025
2be15ed
chore: Specify crane_bricks lib crate version
timothebot Oct 13, 2025
e9ea8d5
chore: Bump version to 0.2.0 because 0.1.0 already existed
timothebot Oct 13, 2025
53521c7
feat: Add ability to parse ~ paths, format code and add LICENSE file …
timothebot Oct 13, 2025
96f2c43
refactor: Fix clippy lints
timothebot Oct 13, 2025
d3f1b1d
style: Run cargo fmt again
timothebot Oct 13, 2025
5436cb7
refactor: Fix clippy issue in test env
timothebot Oct 13, 2025
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
39 changes: 39 additions & 0 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# From https://github.com/rust-lang/mdBook/wiki/Automated-Deployment%3A-GitHub-Actions#GitHub-Pages-Deploy
name: Deploy GH Pages
on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write # To push a branch
pages: write # To push to a GitHub Pages site
id-token: write # To update the deployment status
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install latest mdbook
run: |
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
mkdir mdbook
curl -sSL $url | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Build Book
run: |
cd book
mdbook build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'book'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
33 changes: 33 additions & 0 deletions .github/workflows/publish-crate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish to crates.io

on:
workflow_dispatch:
inputs:
crate:
description: 'Which crate to publish'
required: true
default: 'crane'
type: choice
options:
- crane
- crane_bricks

env:
CARGO_INCREMENTAL: 0

permissions:
contents: write

jobs:
publish-crates:
name: Publish to crates.io
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Publish to crates.io
run: cargo publish -p ${{ inputs.crate }} --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
86 changes: 86 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Release

on:
workflow_dispatch:

env:
CARGO_INCREMENTAL: 0

permissions:
contents: write

jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Get version
id: get_version
uses: SebRollen/toml-action@v1.2.0
with:
file: Cargo.toml
field: package.version
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Setup cache
uses: Swatinem/rust-cache@v2.8.1
with:
key: ${{ matrix.target }}
- name: Install cross
if: ${{ runner.os == 'Linux' }}
uses: actions-rs/cargo@v1
with:
command: install
args: --color=always --git=https://github.com/cross-rs/cross.git --locked --rev=e281947ca900da425e4ecea7483cfde646c8a1ea --verbose cross
- name: Build binary
uses: actions-rs/cargo@v1
with:
command: build
args: --release --locked --target=${{ matrix.target }} --color=always --verbose
use-cross: ${{ runner.os == 'Linux' }}
- name: Package (*nix)
env:
BINARY_NAME: "crane"
run: |
tar -c -C target/${{ matrix.target }}/release/ $BINARY_NAME |
gzip --best > \
$BINARY_NAME-${{ steps.get_version.outputs.value }}-${{ matrix.target }}.tar.gz
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: |
*.tar.gz
*.zip
Cargo.lock
- name: Create release
uses: softprops/action-gh-release@v2
with:
draft: true
files: |
*.tar.gz
*.zip
Cargo.lock
name: v${{ steps.get_version.outputs.value }}
tag_name: ${{ github.ref_name }}
62 changes: 62 additions & 0 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Rust Lint & Test

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

# make sure all code has been formatted with rustfmt
- run: rustup component add rustfmt
- name: check rustfmt
run: cargo fmt -- --check --color always

# run clippy to verify we have no warnings
- run: rustup component add clippy
- run: cargo fetch
- name: cargo clippy
run: cargo clippy --all-targets -- -D warnings

test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo fetch
- name: cargo test build
run: cargo build --tests --release
- name: cargo test
shell: bash
run: cargo test --release
- name: detects powershell
if: ${{ matrix.os != 'macos-14' }}
shell: pwsh
run: cargo test --release -- --ignored is_powershell_true
- name: doesn't detect powershell
if: ${{ matrix.os != 'macos-14' }}
shell: bash
run: cargo test --release -- --ignored is_powershell_false
Loading
Loading