Skip to content
Myr

before_deploy.bash

This file

Path

ci/before_deploy.bash

108 lines · 2.6 KiB · Shell

Last changed by

Address code review:Cade Ekblad-Frankbefore adoptione595be7

History of this file

Take it

The walk stopped after 200 commits: lines older than e3dfc7f point at it.

Bump serde_json from 1.0.34 to 1.0.35dependabot[bot]before adoptione3dfc7f

lines 1–25why, one step back
1#!/usr/bin/env bash
2# Building and packaging for release34set -ex56build() {7 cargo build --target "$TARGET" --release --verbose8}910pack() {11 local tempdir12 local out_dir13 local package_name1415 tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)16 out_dir=$(pwd)17 package_name="$PROJECT_NAME-$TRAVIS_TAG-$TARGET"1819 # create a "staging" directory20 mkdir "$tempdir/$package_name"2122 # copying the main binary23 cp "target/$TARGET/release/$PROJECT_NAME" "$tempdir/$package_name/"24 strip "$tempdir/$package_name/$PROJECT_NAME"25

Address code review:Cade Ekblad-Frankbefore adoptione595be7

lines 26–27why, one step back
26 # manpage, readme and license
27 cp "doc/$PROJECT_NAME.1" "$tempdir/$package_name"

Bump serde_json from 1.0.34 to 1.0.35dependabot[bot]before adoptione3dfc7f

lines 28–71why, one step back
28 cp README.md "$tempdir/$package_name"
29 cp LICENSE-MIT "$tempdir/$package_name"30 cp LICENSE-APACHE "$tempdir/$package_name"3132 # archiving33 pushd "$tempdir"34 tar czf "$out_dir/$package_name.tar.gz" "$package_name"/*35 popd36 rm -r "$tempdir"37}3839make_deb() {40 local tempdir41 local architecture42 local version43 local dpkgname44 local conflictname4546 case $TARGET in47 x86_64*)48 architecture=amd6449 ;;50 i686*)51 architecture=i38652 ;;53 *)54 echo "ERROR: unknown target" >&255 return 156 ;;57 esac58 version=${TRAVIS_TAG#v}59 if [[ $TARGET = *musl* ]]; then60 dpkgname=$PROJECT_NAME-musl61 conflictname=$PROJECT_NAME62 else63 dpkgname=$PROJECT_NAME64 conflictname=$PROJECT_NAME-musl65 fi6667 tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)6869 # copy the main binary70 install -Dm755 "target/$TARGET/release/$PROJECT_NAME" "$tempdir/usr/bin/$PROJECT_NAME"71 strip "$tempdir/usr/bin/$PROJECT_NAME"

Address code review:Cade Ekblad-Frankbefore adoptione595be7

lines 72–75why, one step back
72
73 # manpage74 install -Dm644 "doc/$PROJECT_NAME.1" "$tempdir/usr/share/man/man1/$PROJECT_NAME.1"75 gzip --best "$tempdir/usr/share/man/man1/$PROJECT_NAME.1"

Bump serde_json from 1.0.34 to 1.0.35dependabot[bot]before adoptione3dfc7f

lines 76–108why, one step back
76
77 # readme and license78 install -Dm644 README.md "$tempdir/usr/share/doc/$PROJECT_NAME/README.md"79 install -Dm644 LICENSE-MIT "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE-MIT"80 install -Dm644 LICENSE-APACHE "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE-APACHE"8182 # Control file83 mkdir "$tempdir/DEBIAN"84 cat > "$tempdir/DEBIAN/control" <<EOF85Package: $dpkgname86Version: $version87Section: utils88Priority: optional89Maintainer: David Peter <mail@david-peter.de>90Architecture: $architecture91Provides: $PROJECT_NAME92Conflicts: $conflictname93Description: A command-line benchmarking tool.94EOF9596 fakeroot dpkg-deb --build "$tempdir" "${dpkgname}_${version}_${architecture}.deb"97}9899100main() {101 build102 pack103 if [[ $TARGET = *linux* ]]; then104 make_deb105 fi106}107108main