summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-08-05 16:34:22 -0400
committerDan Davison <dandavison7@gmail.com>2020-08-05 16:37:09 -0400
commitcfd6ed0e077f3667b036902516a0348b1c596441 (patch)
tree678a5bf6ad901fc269a4315dfb7267c8339489a6 /ci
parent2da099e53d5c0a7597757bca5b53bbef5d449e8b (diff)
Reorganize
Diffstat (limited to 'ci')
-rw-r--r--ci/.gitattributes1
-rwxr-xr-xci/before_deploy.sh166
-rwxr-xr-xci/before_install.sh37
-rwxr-xr-xci/script.sh16
4 files changed, 0 insertions, 220 deletions
diff --git a/ci/.gitattributes b/ci/.gitattributes
deleted file mode 100644
index 36eaad9f..00000000
--- a/ci/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* linguist-vendored
diff --git a/ci/before_deploy.sh b/ci/before_deploy.sh
deleted file mode 100755
index c79b8c69..00000000
--- a/ci/before_deploy.sh
+++ /dev/null
@@ -1,166 +0,0 @@
-#!/usr/bin/env bash
-# Building and packaging for release
-
-set -ex
-
-build() {
- cargo build --target "$TARGET" --release --verbose
-}
-
-pack() {
- local tempdir
- local out_dir
- local package_name
- local gcc_prefix
-
- tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)
- out_dir=$(pwd)
- package_name="$PROJECT_NAME-$TRAVIS_TAG-$TARGET"
-
- if [[ $TARGET == "arm-unknown-linux-gnueabihf" ]]; then
- gcc_prefix="arm-linux-gnueabihf-"
- elif [[ $TARGET == "aarch64-unknown-linux-gnu" ]]; then
- gcc_prefix="aarch64-linux-gnu-"
- else
- gcc_prefix=""
- fi
-
- # create a "staging" directory
- mkdir "$tempdir/$package_name"
-
- # copying the main binary
- cp "target/$TARGET/release/$PROJECT_NAME" "$tempdir/$package_name/"
- if [ "$TRAVIS_OS_NAME" != windows ]; then
- "${gcc_prefix}"strip "$tempdir/$package_name/$PROJECT_NAME"
- fi
-
- # manpage, readme and license
- cp README.md "$tempdir/$package_name"
- cp LICENSE "$tempdir/$package_name"
-
- # archiving
- pushd "$tempdir"
- if [ "$TRAVIS_OS_NAME" = windows ]; then
- 7z a "$out_dir/$package_name.zip" "$package_name"/*
- else
- tar czf "$out_dir/$package_name.tar.gz" "$package_name"/*
- fi
- popd
- rm -r "$tempdir"
-}
-
-make_deb() {
- local tempdir
- local architecture
- local version
- local dpkgname
- local conflictname
- local gcc_prefix
- local homepage
- local maintainer
-
- homepage="https://github.com/dandavison/delta"
- maintainer="Dan Davison <dandavison7@gmail.com>"
-
- case $TARGET in
- x86_64*)
- architecture=amd64
- gcc_prefix=""
- ;;
- i686*)
- architecture=i386
- gcc_prefix=""
- ;;
- aarch64*)
- architecture=arm64
- gcc_prefix="aarch64-linux-gnu-"
- ;;
- arm*hf)
- architecture=armhf
- gcc_prefix="arm-linux-gnueabihf-"
- ;;
- *)
- echo "make_deb: skipping target '${TARGET}'" >&2
- return 0
- ;;
- esac
- version=${TRAVIS_TAG#v}
- if [[ $TARGET = *musl* ]]; then
- dpkgname=$PACKAGE_NAME-musl
- conflictname=$PROJECT_NAME
- else
- dpkgname=$PACKAGE_NAME
- conflictname=$PROJECT_NAME-musl
- fi
-
- tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)
-
- # copy the main binary
- install -Dm755 "target/$TARGET/release/$PROJECT_NAME" "$tempdir/usr/bin/$PROJECT_NAME"
- "${gcc_prefix}"strip "$tempdir/usr/bin/$PROJECT_NAME"
-
- # readme and license
- install -Dm644 README.md "$tempdir/usr/share/doc/$PROJECT_NAME/README.md"
- install -Dm644 LICENSE "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE"
- cat > "$tempdir/usr/share/doc/$PROJECT_NAME/copyright" <<EOF
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: $PROJECT_NAME
-Source: $homepage
-
-Files: *
-Copyright: $maintainer
-License: MIT
-
-License: MIT
- Permission is hereby granted, free of charge, to any
- person obtaining a copy of this software and associated
- documentation files (the "Software"), to deal in the
- Software without restriction, including without
- limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of
- the Software, and to permit persons to whom the Software
- is furnished to do so, subject to the following
- conditions:
- .
- The above copyright notice and this permission notice
- shall be included in all copies or substantial portions
- of the Software.
- .
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
- ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
- TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
- SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
- IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-EOF
-
- # Control file
- mkdir "$tempdir/DEBIAN"
- cat > "$tempdir/DEBIAN/control" <<EOF
-Package: $dpkgname
-Version: $version
-Section: utils
-Priority: optional
-Maintainer: Dan Davison <dandavison7@gmail.com>
-Architecture: $architecture
-Provides: $PROJECT_NAME
-Conflicts: $conflictname
-Description: A syntax highlighter for git.
-EOF
-
- fakeroot dpkg-deb --build "$tempdir" "${dpkgname}_${version}_${architecture}.deb"
-}
-
-
-main() {
- build
- pack
- if [[ $TARGET = *linux* ]]; then
- make_deb
- fi
-}
-
-main
diff --git a/ci/before_install.sh b/ci/before_install.sh
deleted file mode 100755
index 9acf6025..00000000
--- a/ci/before_install.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env bash
-
-set -ex
-
-if [ "$TRAVIS_OS_NAME" != linux ]; then
- exit 0
-fi
-
-sudo apt-get update
-
-# needed for musl targets
-sudo apt-get install -y musl-tools
-
-# needed to build deb packages
-sudo apt-get install -y fakeroot
-
-# needed for i686 linux gnu target
-if [[ $TARGET == i686-unknown-linux-gnu ]]; then
- sudo apt-get install -y gcc-multilib
-fi
-
-# needed for cross-compiling for arm
-if [[ $TARGET == arm-unknown-linux-gnueabihf ]]; then
- sudo apt-get install -y \
- gcc-4.8-arm-linux-gnueabihf \
- binutils-arm-linux-gnueabihf \
- libc6-armhf-cross \
- libc6-dev-armhf-cross
-fi
-
-# needed for cross-compiling for arm64
-if [[ $TARGET == aarch64-unknown-linux-gnu ]]; then
- sudo apt-get install -y \
- gcc-4.8-aarch64-linux-gnu \
- binutils-aarch64-linux-gnu \
- gcc-aarch64-linux-gnu
-fi
diff --git a/ci/script.sh b/ci/script.sh
deleted file mode 100755
index e6e505ad..00000000
--- a/ci/script.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env bash
-
-set -ex
-
-# Incorporate TARGET env var to the build and test process
-cargo build --target "$TARGET" --verbose
-
-# We cannot run arm executables on linux
-if [[ $TARGET != arm-unknown-linux-gnueabihf ]] && [[ $TARGET != aarch64-unknown-linux-gnu ]]; then
- cargo test --target "$TARGET" --verbose
- cargo build --release
- ./tests/test_raw_output_matches_git_on_full_repo_history
- ./tests/test_deprecated_options > /dev/null
-
- cargo run --target "$TARGET" -- < /dev/null
-fi