File: package

package info (click to toggle)
rust-just 1.45.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,196 kB
  • sloc: sh: 300; makefile: 6
file content (54 lines) | stat: -rwxr-xr-x 1,149 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bash

set -euxo pipefail

VERSION=${REF#"refs/tags/"}
DIST=`pwd`/dist

echo "Packaging just $VERSION for $TARGET..."

test -f Cargo.lock || cargo generate-lockfile

echo "Installing rust toolchain for $TARGET..."
rustup target add $TARGET

if [[ $TARGET == aarch64-unknown-linux-musl ]]; then
  export CC=aarch64-linux-gnu-gcc
fi

echo "Building just..."
RUSTFLAGS="--deny warnings --codegen target-feature=+crt-static $TARGET_RUSTFLAGS" \
  cargo build --bin just --target $TARGET --release
EXECUTABLE=target/$TARGET/release/just

if [[ $OS == windows-latest ]]; then
  EXECUTABLE=$EXECUTABLE.exe
fi

echo "Copying release files..."
mkdir dist
cp -r \
  $EXECUTABLE \
  Cargo.lock \
  Cargo.toml \
  GRAMMAR.md \
  LICENSE \
  README.md \
  completions \
  man/just.1 \
  $DIST

cd $DIST
echo "Creating release archive..."
case $OS in
  ubuntu-latest | macos-latest)
    ARCHIVE=just-$VERSION-$TARGET.tar.gz
    tar czf $ARCHIVE *
    echo "archive=$DIST/$ARCHIVE" >> $GITHUB_OUTPUT
    ;;
  windows-latest)
    ARCHIVE=just-$VERSION-$TARGET.zip
    7z a $ARCHIVE *
    echo "archive=`pwd -W`/$ARCHIVE" >> $GITHUB_OUTPUT
    ;;
esac