[tasks.createrelease] condition = { env_set = ["TARGET", "OUTPUT"], fail_message = "createrelease: necessary env not specified" } command = "cross" args = ["build", "--frozen", "--target-dir=${OUTPUT}/cross", "--release", "--target=${TARGET}"] [tasks.createrelease-host] extend = "createrelease" command = "cargo" args = ["build", "--frozen", "--target-dir=${OUTPUT}/host", "--release", "--target=${TARGET}"] [tasks.createrelease-host-zbuild] extend = "createrelease-host" args = ["build", "-Zbuild-std=std", "--frozen", "--target-dir=${OUTPUT}/host", "--release", "--target=${TARGET}"] # Linux GNU targets [tasks.release-x86_64-linux-gnu] env = { TARGET = ["x86_64-unknown-linux-gnu"] } run_task = "createrelease" [tasks.release-aarch64-linux-gnu] env = { TARGET = "aarch64-unknown-linux-gnu" } run_task = "createrelease" [tasks.release-x86-linux-gnu] env = { TARGET = ["i686-unknown-linux-gnu"] } run_task = "createrelease" [tasks.release-armv7-linux-gnueabihf] env = { TARGET = "armv7-unknown-linux-gnueabihf" } run_task = "createrelease" [tasks.release-riscv64-linux-gnu] env = { TARGET = "riscv64gc-unknown-linux-gnu" } run_task = "createrelease-host" [tasks.release-mips-linux-gnu] env = { TARGET = "mips-unknown-linux-gnu" } run_task = "createrelease-host-zbuild" # Android targets [tasks.release-x86_64-android] env = { TARGET = "x86_64-linux-android" } run_task = "createrelease" [tasks.release-aarch64-android] env = { TARGET = "aarch64-linux-android" } run_task = "createrelease" # musl targets # These are statically built, so will work on more platforms [tasks.release-arm-linux-musleabi] env = { TARGET = "arm-unknown-linux-musleabi" } run_task = "createrelease" [tasks.release-aarch64-linux-musl] env = { TARGET = "aarch64-unknown-linux-musl" } run_task = "createrelease" [tasks.post-releases] condition = { env_set = ["OUTNAME", "ZIPOUT"], fail_message = "post-releases: necessary env not specified" } script = """ #!/usr/bin/env bash BASE="${ZIPOUT}/${OUTNAME}" OUT="${BASE}/zips/${CARGO_MAKE_PROJECT_VERSION}" mkdir -p ${OUT}; createzips() { DIR=$1 # Create the actual zip files if test -d ${DIR}; then ls ${DIR} | while read line; do if test -d ${DIR}/$line && test -f "${DIR}/${line}/release/${OUTNAME}"; then zip -j ${OUT}/${OUTNAME}-${line}-${CARGO_MAKE_PROJECT_VERSION}.zip ${DIR}/${line}/release/${OUTNAME} fi done fi } # Delete old files that may be there, we don't want to copy stale files as a # release ls ${OUT} | while read line; do if test -f ${OUT}/$line; then rm ${OUT}/$line fi done createzips "${BASE}/host" createzips "${BASE}/cross" """ [tasks.releases] run_task = [ { name = [ "release-x86_64-linux-gnu", "release-aarch64-linux-gnu", "release-x86-linux-gnu", "release-armv7-linux-gnueabihf", "release-x86_64-android", "release-aarch64-android", "release-arm-linux-musleabi", "release-aarch64-linux-musl", "release-riscv64-linux-gnu", "release-mips-linux-gnu", ] }, ] [tasks.createzips] condition = { env_set = ["OUTNAME", "ZIPOUT"], fail_message = "createzips: necessary env not specified" } env = { OUTPUT = "${ZIPOUT}/${OUTNAME}" } run_task = [ { name = [ "releases", "post-releases", ] } ]