a6a81cce1b
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
117 lines
3.9 KiB
Makefile
117 lines
3.9 KiB
Makefile
# SPDX-FileCopyrightText: 2023 Christina Sørensen
|
|
# SPDX-FileContributor: Christina Sørensen
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
name := "fortune-kind"
|
|
|
|
#---------------#
|
|
# 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 --sign -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"
|
|
|
|
git push origin "v{{new_version}}"
|
|
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
|
|
|