cargo-matrix 0.4.6

Run feature matrices against cargo commands that support feature lists
#!/usr/bin/env fish
# Stage: publish the built release-assets/ (the 5 platform archives --
# audit.ok is a marker, not a shippable artifact, and deliberately excluded)
# to a plain static download directory on this machine, served at
# https://git.jasonozias.com/dl/cargo-matrix/$RELEASE_TAG/<asset> (see
# [package.metadata.binstall] in Cargo.toml, which points there).
#
# No secrets, no GitHub Release object -- repomon has no GitHub API
# integration, so unlike the old release.yml this pipeline needs no
# `gh release create` step.

source (path dirname (status --current-filename))/lib.fish

cd (rel_repo_root)
or rel_die "not inside the cargo-matrix git repo"

rel_resolve_tag

if rel_is_rc
    rel_log "$RELEASE_TAG is a pre-release tag -- nothing to do here"
    exit 0
end

set -l dest /opt/releases/cargo-matrix/$RELEASE_TAG
if not test -d /opt/releases/cargo-matrix
    rel_die "/opt/releases/cargo-matrix does not exist -- do the one-time infra setup first"
end

set -l pkgver $RELEASE_PKGVER
for f in release-assets/cargo-matrix-x86_64-unknown-linux-gnu-v$pkgver.tar.gz \
    release-assets/cargo-matrix-aarch64-unknown-linux-gnu-v$pkgver.tar.gz \
    release-assets/cargo-matrix-aarch64-apple-darwin-v$pkgver.tar.gz \
    release-assets/cargo-matrix-x86_64-apple-darwin-v$pkgver.tar.gz \
    release-assets/cargo-matrix-x86_64-pc-windows-msvc-v$pkgver.zip
    test -f $f
    or rel_die "$f not found -- run dispatch-remote-builds.fish first"
end

rel_log "generating SHA256SUMS"
pushd release-assets
sha256sum cargo-matrix-*-v$pkgver.* >SHA256SUMS
or begin
    popd
    rel_die "failed to generate SHA256SUMS"
end
popd

rel_log "publishing release-assets/ to $dest"
mkdir -p $dest
or rel_die "failed to create $dest"

for f in release-assets/cargo-matrix-*-v$pkgver.* release-assets/SHA256SUMS
    install -Dm644 $f $dest/(path basename $f)
    or rel_die "failed to install $f to $dest"
end

rel_log "published. Verify with:"
rel_log "  curl -I https://git.jasonozias.com/dl/cargo-matrix/$RELEASE_TAG/cargo-matrix-x86_64-unknown-linux-gnu-v$pkgver.tar.gz"