bat/ci/before_deploy.bash
2# Building and packaging for release
7 cargo build --target "$TARGET" --release --verbose
16 tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)
18 package_name="$PROJECT_NAME-$TRAVIS_TAG-$TARGET"
20 if [[ $TARGET == "arm-unknown-linux-gnueabihf" ]]; then
21 gcc_prefix="arm-linux-gnueabihf-"
22 elif [[ $TARGET == "aarch64-unknown-linux-gnu" ]]; then
23 gcc_prefix="aarch64-linux-gnu-"
28 # create a "staging" directory
29 mkdir "$tempdir/$package_name"
30 mkdir "$tempdir/$package_name/autocomplete"
32 # copying the main binary
33 cp "target/$TARGET/release/$PROJECT_NAME" "$tempdir/$package_name/"
34 "${gcc_prefix}"strip "$tempdir/$package_name/$PROJECT_NAME"
36 # manpage, readme and license
37 cp "doc/$PROJECT_NAME.1" "$tempdir/$package_name"
38 cp README.md "$tempdir/$package_name"
39 cp LICENSE-MIT "$tempdir/$package_name"
40 cp LICENSE-APACHE "$tempdir/$package_name"
42 # various autocomplete
43 # TODO: disabled for now, see issue #372
44 # cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/"$PROJECT_NAME".bash "$tempdir/$package_name/autocomplete/${PROJECT_NAME}.bash-completion"
45 # cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/"$PROJECT_NAME".fish "$tempdir/$package_name/autocomplete"
46 cp assets/completions/bat.fish "$tempdir/$package_name/autocomplete"
47 # cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/_"$PROJECT_NAME" "$tempdir/$package_name/autocomplete"
51 tar czf "$out_dir/$package_name.tar.gz" "$package_name"/*
66 homepage="https://github.com/sharkdp/bat"
67 maintainer="David Peter <mail@david-peter.de>"
80 gcc_prefix="aarch64-linux-gnu-"
84 gcc_prefix="arm-linux-gnueabihf-"
87 echo "make_deb: skipping target '${TARGET}'" >&2
91 version=${TRAVIS_TAG#v}
92 if [[ $TARGET = *musl* ]]; then
93 dpkgname=$PROJECT_NAME-musl
94 conflictname=$PROJECT_NAME
96 dpkgname=$PROJECT_NAME
97 conflictname=$PROJECT_NAME-musl
100 tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)
102 # copy the main binary
103 install -Dm755 "target/$TARGET/release/$PROJECT_NAME" "$tempdir/usr/bin/$PROJECT_NAME"
104 "${gcc_prefix}"strip "$tempdir/usr/bin/$PROJECT_NAME"
107 install -Dm644 "doc/$PROJECT_NAME.1" "$tempdir/usr/share/man/man1/$PROJECT_NAME.1"
108 gzip --best "$tempdir/usr/share/man/man1/$PROJECT_NAME.1"
111 install -Dm644 assets/completions/bat.fish "$tempdir/usr/share/fish/completions/$PROJECT_NAME.fish"
114 install -Dm644 README.md "$tempdir/usr/share/doc/$PROJECT_NAME/README.md"
115 install -Dm644 LICENSE-MIT "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE-MIT"
116 install -Dm644 LICENSE-APACHE "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE-APACHE"
117 cat > "$tempdir/usr/share/doc/$PROJECT_NAME/copyright" <<EOF
118Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
119Upstream-Name: $PROJECT_NAME
123Copyright: $maintainer
124License: Apache-2.0 or MIT
127 On Debian systems, the complete text of the Apache-2.0 can be found in the
128 file /usr/share/common-licenses/Apache-2.0.
131 Permission is hereby granted, free of charge, to any
132 person obtaining a copy of this software and associated
133 documentation files (the "Software"), to deal in the
134 Software without restriction, including without
135 limitation the rights to use, copy, modify, merge,
136 publish, distribute, sublicense, and/or sell copies of
137 the Software, and to permit persons to whom the Software
138 is furnished to do so, subject to the following
141 The above copyright notice and this permission notice
142 shall be included in all copies or substantial portions
145 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
146 ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
147 TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
148 PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
149 SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
150 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
151 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
152 IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
153 DEALINGS IN THE SOFTWARE.
157 mkdir "$tempdir/DEBIAN"
158 cat > "$tempdir/DEBIAN/control" <<EOF
163Maintainer: David Peter <mail@david-peter.de>
164Architecture: $architecture
165Provides: $PROJECT_NAME
166Conflicts: $conflictname
167Description: A cat(1) clone with wings.
168 A cat(1) clone with syntax highlighting and Git integration.
171 fakeroot dpkg-deb --build "$tempdir" "${dpkgname}_${version}_${architecture}.deb"
178 if [[ $TARGET = *linux* ]]; then
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list