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
25 changes: 25 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ jobs:
- name: Refresh tags
run: git fetch --force --tags origin

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo artifacts
uses: Swatinem/rust-cache@v2

- name: Configure git author
run: |
git config user.name "github-actions[bot]"
Expand Down Expand Up @@ -240,6 +246,25 @@ jobs:
git commit -m "chore: bump version to ${RELEASE_VERSION} (${BUMP_LEVEL}) [skip release]"
git push origin "HEAD:main"

- name: Publish crate to crates.io
env:
RELEASE_VERSION: ${{ steps.version.outputs.release_version }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
set -euo pipefail

if curl -fsSL "https://crates.io/api/v1/crates/deff/${RELEASE_VERSION}" >/dev/null 2>&1; then
echo "deff ${RELEASE_VERSION} is already published on crates.io"
exit 0
fi

if [ -z "${CARGO_REGISTRY_TOKEN}" ]; then
echo "CARGO_REGISTRY_TOKEN secret is not set"
exit 1
fi

cargo publish --locked --token "${CARGO_REGISTRY_TOKEN}"

- name: Create and push release tag
env:
RELEASE_TAG: ${{ steps.version.outputs.release_tag }}
Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,21 @@ My name is deff

## Quickstart

Run the installer script from this repository:
Choose one install method:

1. Install from crates.io with Cargo:

```bash
cargo install deff
```

2. Run the installer script from this repository:

```bash
curl -fsSL https://raw.githubusercontent.com/flamestro/deff/main/install.sh | bash
```

Installer source: https://github.com/flamestro/deff/blob/main/install.sh
Installer script source: https://github.com/flamestro/deff/blob/main/install.sh

The script checks for `cargo`, clones this project into a temporary directory, installs it, and removes the temporary checkout.
Bundled syntax grammars are compiled into the binary, so removing the checkout does not affect highlighting.
Expand Down Expand Up @@ -126,8 +134,9 @@ Search and reviewed workflow:

This repo ships with `.github/workflows/bump-version.yml`.

- Trigger: publish a GitHub release with a tag like `v0.1.0`
- Updates `Cargo.toml`/`Cargo.lock` on the default branch using commit prefixes (`feat:` -> next minor, `chore:`/`docs:` -> next patch)
- Trigger: push to `main` (excluding commits authored by `github-actions[bot]`)
- Computes the next version from commit prefixes (`feat:` -> next minor, `fix:`/`chore:`/`docs:` -> next patch) and updates `Cargo.toml`/`Cargo.lock` when needed
- Publishes new crate versions to crates.io and then creates/pushes the matching `vX.Y.Z` tag and GitHub release

## Contributing

Expand Down