Skip to content

Commit

Permalink
docs: add rime header and just file and stuff
Browse files Browse the repository at this point in the history
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
  • Loading branch information
cafkafk committed Oct 27, 2023
1 parent ec46989 commit b5335cc
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
use flake .
if has nix; then
use flake .
fi
if has kitty; then
kitty +icat docs/images/rime.jpg
fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only

<h1>RIME</h1>

![Rimed_hexagonal_snow_crystal TIF](https://github.com/cafkafk/rime/assets/89321978/c6490432-e6d2-430d-8437-b2506c2dae88)
![Rimed hexagonal snow crystal under electron microscope](docs/images/rime.jpg)

Nix Flake Input Versioning

Expand Down
Binary file added docs/images/Rimed_hexagonal_snow_crystal.TIF.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/rime.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: AGPL-3.0-only

{
description = "xinx: Nix Flakes Version Stuff Fancy";
description = "rime: Nix Flakes Version Stuff Fancy";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
Expand Down
114 changes: 114 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name := "rime"

cropHeader:
convert docs/images/Rimed_hexagonal_snow_crystal.TIF.jpg -crop 1024x325+0+380 docs/images/rime.jpg && kitty +icat docs/images/rime.jpg

#---------------#
# release #
#---------------#

new_version := "$(convco version --bump)"

# If you're not cafkafk and she isn't dead, don't run this!
release:
cargo bump "{{new_version}}"
git cliff -t "{{new_version}}" > CHANGELOG.md
cargo check
nix build -L ./#clippy
git checkout -b "cafk-release-v{{new_version}}"
git commit -asm "chore: release {{name}} v{{new_version}}"
git push
@echo "waiting 10 seconds for github to catch up..."
sleep 10
gh pr create --draft --title "chore: release v{{new_version}}" --body "This PR was auto-generated by our lovely just file" --reviewer cafkafk
@echo "Now go review that and come back and run gh-release"

@gh-release:
git tag -d "v{{new_version}}" || echo "tag not found, creating";
git tag -a "v{{new_version}}" -m "auto generated by the justfile for {{name}} v$(convco version)"
just cross
mkdir -p ./target/"release-notes-$(convco version)"
git cliff -t "v$(convco version)" --current > ./target/"release-notes-$(convco version)/RELEASE.md"
just checksum >> ./target/"release-notes-$(convco version)/RELEASE.md"

gh release create "v$(convco version)" --target "$(git rev-parse HEAD)" --title "{{name}} v$(convco version)" -d -F ./target/"release-notes-$(convco version)/RELEASE.md" ./target/"bin-$(convco version)"/*

#----------------#
# binaries #
#----------------#

tar BINARY TARGET:
tar czvf ./target/"bin-$(convco version)"/{{BINARY}}_{{TARGET}}.tar.gz -C ./target/{{TARGET}}/release/ ./{{BINARY}}

zip BINARY TARGET:
zip -j ./target/"bin-$(convco version)"/{{BINARY}}_{{TARGET}}.zip ./target/{{TARGET}}/release/{{BINARY}}

tar_static BINARY TARGET:
tar czvf ./target/"bin-$(convco version)"/{{BINARY}}_{{TARGET}}_static.tar.gz -C ./target/{{TARGET}}/release/ ./{{BINARY}}

zip_static BINARY TARGET:
zip -j ./target/"bin-$(convco version)"/{{BINARY}}_{{TARGET}}_static.zip ./target/{{TARGET}}/release/{{BINARY}}

binary BINARY TARGET:
rustup target add {{TARGET}}
cross build --release --target {{TARGET}}
just tar {{BINARY}} {{TARGET}}
just zip {{BINARY}} {{TARGET}}

binary_static BINARY TARGET:
rustup target add {{TARGET}}
RUSTFLAGS='-C target-feature=+crt-static' cross build --release --target {{TARGET}}
just tar_static {{BINARY}} {{TARGET}}
just zip_static {{BINARY}} {{TARGET}}

checksum:
@echo "# Checksums"
@echo "## sha256sum"
@echo '```'
@sha256sum ./target/"bin-$(convco version)"/*
@echo '```'
@echo "## md5sum"
@echo '```'
@md5sum ./target/"bin-$(convco version)"/*
@echo '```'

alias c := cross

# Generate release binaries
#
# usage: cross
@cross:
# Setup Output Directory
mkdir -p ./target/"bin-$(convco version)"

# Install Toolchains/Targets
rustup toolchain install stable

## Linux
### x86
just binary {{name}} x86_64-unknown-linux-gnu
# just binary_static {{name}} x86_64-unknown-linux-gnu
just binary {{name}} x86_64-unknown-linux-musl
just binary_static {{name}} x86_64-unknown-linux-musl

### aarch
just binary {{name}} aarch64-unknown-linux-gnu
# BUG: just binary_static {{name}} aarch64-unknown-linux-gnu

### arm
just binary {{name}} arm-unknown-linux-gnueabihf
# just binary_static {{name}} arm-unknown-linux-gnueabihf

## MacOS
# TODO: just binary {{name}} x86_64-apple-darwin

## Windows
### x86
just binary {{name}}.exe x86_64-pc-windows-gnu
# just binary_static {{name}}.exe x86_64-pc-windows-gnu
# TODO: just binary {{name}}.exe x86_64-pc-windows-gnullvm
# TODO: just binary {{name}}.exe x86_64-pc-windows-msvc

# Generate Checksums
# TODO: moved to gh-release just checksum

0 comments on commit b5335cc

Please sign in to comment.