diff --git a/.envrc b/.envrc index a5dbbcb..e9a1638 100644 --- a/.envrc +++ b/.envrc @@ -1 +1,6 @@ -use flake . +if has nix; then + use flake . +fi +if has kitty; then + kitty +icat docs/images/rime.jpg +fi diff --git a/README.md b/README.md index 0a60f1d..dbae273 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only

RIME

-![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 diff --git a/docs/images/Rimed_hexagonal_snow_crystal.TIF.jpg b/docs/images/Rimed_hexagonal_snow_crystal.TIF.jpg new file mode 100644 index 0000000..1a23b0f Binary files /dev/null and b/docs/images/Rimed_hexagonal_snow_crystal.TIF.jpg differ diff --git a/docs/images/rime.jpg b/docs/images/rime.jpg new file mode 100644 index 0000000..e221484 Binary files /dev/null and b/docs/images/rime.jpg differ diff --git a/flake.nix b/flake.nix index ab92078..3856575 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; diff --git a/justfile b/justfile new file mode 100644 index 0000000..7f92f8f --- /dev/null +++ b/justfile @@ -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 +