Create deb file as part of CI build. WIP
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Thayne McCombs · committed by David Peter · parent c165ff0 · Browse files · 2 files·+71 added−1 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+71 added−1 removed
- other:+71 added−1 removed
Provenance
- Commit
59ea560- Tree
1a30cbe- Author
Thayne McCombs <astrothayne@gmail.com>- Committer
David Peter <sharkdp@users.noreply.github.com>- Parent
c165ff0
2 files changed+71 added−1 removed
modified:ci/before_deploy.bash+68 added
40 unmodified lines414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711840 unmodified lines popd rm -r "$tempdir"}
make_deb() { local tempdir local architecture local version local dpkgname local conflictname
case $TARGET in x86_64*) architecture=amd64 ;; i686*) architecture=i386 ;; *) echo "ERROR: unknown target" >&2 return 1 ;; esac version=${TRAVIS_TAG#v} if [[ $TARGET = *musl* ]]; then dpkgname=$PACKAGE_NAME-musl conflictname=$PACKAGE_NAME else dpkgname=$PACKAGE_NAME conflictname=$PACKAGE_NAME-musl fi
tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)
# copy the main binary install -Dm755 "target/$TARGET/release/build/$PROJECT_NAME" "$tempdir/usr/bin/$PROJECT_NAME" strip "$tempdir/usr/bin/$PROJECT_NAME"
# manpage install -Dm644 "doc/$PROJECT_NAME.1" "$tempdir/usr/share/man/man1/$PROJECT_NAME.1"
# readme and license install -Dm644 README.md "$tempdir/usr/share/doc/$PACKAGE_NAME/README.md" install -Dm644 LICENSE-MIT "$tempdir/usr/share/doc/$PACKAGE_NAME/LICENSE-MIT" install -Dm644 LICENSE-APACHE "$tempdir/usr/share/doc/$PACKAGE_NAME/LICENSE-APACHE"
# completions install -Dm644 target/$TARGET/release/build/$PROJECT_NAME-*/out/$PROJECT_NAME.bash_completion "$tempdir/usr/share/bash-completion/completions/$PROJECT_NAME.bash_completion" install -Dm644 target/$TARGET/release/build/$PROJECT_NAME-*/out/$PROJECT_NAME.fish "$tempdir/usr/share/fish/vendor_completions.d/$PROJECT_NAME.fish" install -Dm644 target/$TARGET/release/build/$PROJECT_NAME-*/out/_$PROJECT_NAME "$tempdir/usr/share/zsh/site-functions/_$PROJECT_NAME"
# Control file mkdir "$tempdir/DEBIAN" cat > "$tempdir/DEBIAN/control" <<EOFPackage: $dpkgnameVersion: $versionSection: utilsPriority: optionalMaintainer: David PeterArchitecture: $architectureProvides: $PACKAGE_NAMEConflicts: $conflictnameDescription: Simple, fast and user-friendly alternative to findEOF
dpkg-deb --build "$tempdir" "${dpkgname}_${version}_${architecture}.deb"}
main() { build pack if [[ $TARGET = *linux* ]]; then make_deb fi}
mainmodified:.travis.yml+3 added-1 removed
129 unmodified lines130 # NOTE explanation on each env variable131 # - PROJECT_NAME: name of the project, set on the `env.global` above132 # - TRAVIS_TAG: tag name that the build is being deployed for, usually the version number133 # - TARGET: target triple of the build134+ file:134- file: $PROJECT_NAME-$TRAVIS_TAG-$TARGET.*135+ - $PROJECT_NAME-$TRAVIS_TAG-$TARGET.*136+ - $PROJECT_NAME*.deb137 # don't delete artifacts from previous stage138 skip_cleanup: true139 on:140 # deploy only if we push a tag7 unmodified lines