Migrate to GitHub actions
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Peter · committed by David Peter · parent 024309f · Browse files · 7 files·+333 added−392 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
7 files+333 added−392 removed
- other:+333 added−392 removed
Provenance
- Commit
1d85e31- Tree
157cb9d- Author
David Peter <mail@david-peter.de>- Committer
David Peter <sharkdp@users.noreply.github.com>- Parent
024309f
7 files changed+333 added−392 removed
added:.github/workflows/CICD.yml+333 added
1+name: CICD2+3+env:4+ MIN_SUPPORTED_RUST_VERSION: "1.40.0"5+ CICD_INTERMEDIATES_DIR: "_cicd-intermediates"6+7+on:8+ workflow_dispatch:9+ pull_request:10+ push:11+ branches:12+ - master13+ tags:14+ - '*'15+16+jobs:17+ min_version:18+ name: Minimum supported rust version19+ runs-on: ubuntu-18.0420+ steps:21+ - name: Checkout source code22+ uses: actions/checkout@v223+24+ - name: Install rust toolchain (v${{ env.MIN_SUPPORTED_RUST_VERSION }})25+ uses: actions-rs/toolchain@v126+ with:27+ toolchain: ${{ env.MIN_SUPPORTED_RUST_VERSION }}28+ default: true29+ profile: minimal # minimal component installation (ie, no documentation)30+ components: clippy31+ - name: Run clippy (on minimum supported rust version to prevent warnings we can't fix)32+ uses: actions-rs/cargo@v133+ with:34+ command: clippy35+ args: --all-targets --all-features36+ - name: Run tests37+ uses: actions-rs/cargo@v138+ with:39+ command: test40+41+ build:42+ name: ${{ matrix.job.os }} (${{ matrix.job.target }})43+ runs-on: ${{ matrix.job.os }}44+ strategy:45+ fail-fast: false46+ matrix:47+ job:48+ - { os: ubuntu-18.04, target: arm-unknown-linux-gnueabihf , use-cross: true }49+ - { os: ubuntu-18.04, target: arm-unknown-linux-musleabihf, use-cross: true }50+ - { os: ubuntu-18.04, target: aarch64-unknown-linux-gnu , use-cross: true }51+ - { os: ubuntu-18.04, target: i686-unknown-linux-gnu , use-cross: true }52+ - { os: ubuntu-18.04, target: i686-unknown-linux-musl , use-cross: true }53+ - { os: ubuntu-18.04, target: x86_64-unknown-linux-gnu }54+ - { os: ubuntu-18.04, target: x86_64-unknown-linux-musl , use-cross: true }55+ - { os: macos-10.15 , target: x86_64-apple-darwin }56+ # - { os: windows-2019, target: i686-pc-windows-gnu } ## disabled; error: linker `i686-w64-mingw32-gcc` not found57+ - { os: windows-2019, target: i686-pc-windows-msvc }58+ - { os: windows-2019, target: x86_64-pc-windows-gnu }59+ - { os: windows-2019, target: x86_64-pc-windows-msvc }60+ steps:61+ - name: Checkout source code62+ uses: actions/checkout@v263+64+ - name: Install prerequisites65+ shell: bash66+ run: |67+ case ${{ matrix.job.target }} in68+ arm-unknown-linux-gnueabihf) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;69+ aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;70+ esac71+72+ - name: Extract crate information73+ shell: bash74+ run: |75+ echo "PROJECT_NAME=fd" >> $GITHUB_ENV76+ echo "PROJECT_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV77+ echo "PROJECT_MAINTAINER=$(sed -n 's/^authors = \["\(.*\)"\]/\1/p' Cargo.toml)" >> $GITHUB_ENV78+ echo "PROJECT_HOMEPAGE=$(sed -n 's/^homepage = "\(.*\)"/\1/p' Cargo.toml)" >> $GITHUB_ENV79+80+ - name: Install Rust toolchain81+ uses: actions-rs/toolchain@v182+ with:83+ toolchain: stable84+ target: ${{ matrix.job.target }}85+ override: true86+ profile: minimal # minimal component installation (ie, no documentation)87+88+ - name: Show version information (Rust, cargo, GCC)89+ shell: bash90+ run: |91+ gcc --version || true92+ rustup -V93+ rustup toolchain list94+ rustup default95+ cargo -V96+ rustc -V97+98+ - name: Build99+ uses: actions-rs/cargo@v1100+ with:101+ use-cross: ${{ matrix.job.use-cross }}102+ command: build103+ args: --release --target=${{ matrix.job.target }}104+105+ - name: Strip debug information from executable106+ id: strip107+ shell: bash108+ run: |109+ # Figure out suffix of binary110+ EXE_suffix=""111+ case ${{ matrix.job.target }} in112+ *-pc-windows-*) EXE_suffix=".exe" ;;113+ esac;114+115+ # Figure out what strip tool to use if any116+ STRIP="strip"117+ case ${{ matrix.job.target }} in118+ arm-unknown-linux-gnueabihf) STRIP="arm-linux-gnueabihf-strip" ;;119+ aarch64-unknown-linux-gnu) STRIP="aarch64-linux-gnu-strip" ;;120+ *-pc-windows-msvc) STRIP="" ;;121+ esac;122+123+ # Setup paths124+ BIN_DIR="${{ env.CICD_INTERMEDIATES_DIR }}/stripped-release-bin/"125+ mkdir -p "${BIN_DIR}"126+ BIN_NAME="${{ env.PROJECT_NAME }}${EXE_suffix}"127+ BIN_PATH="${BIN_DIR}/${BIN_NAME}"128+129+ # Copy the release build binary to the result location130+ cp "target/${{ matrix.job.target }}/release/${BIN_NAME}" "${BIN_DIR}"131+132+ # Also strip if possible133+ if [ -n "${STRIP}" ]; then134+ "${STRIP}" "${BIN_PATH}"135+ fi136+137+ # Let subsequent steps know where to find the (stripped) bin138+ echo ::set-output name=BIN_PATH::${BIN_PATH}139+ echo ::set-output name=BIN_NAME::${BIN_NAME}140+141+ - name: Set testing options142+ id: test-options143+ shell: bash144+ run: |145+ # test only library unit tests and binary for arm-type targets146+ unset CARGO_TEST_OPTIONS147+ unset CARGO_TEST_OPTIONS ; case ${{ matrix.job.target }} in arm-* | aarch64-*) CARGO_TEST_OPTIONS="--lib --bin ${PROJECT_NAME}" ;; esac;148+ echo ::set-output name=CARGO_TEST_OPTIONS::${CARGO_TEST_OPTIONS}149+150+ - name: Run tests151+ uses: actions-rs/cargo@v1152+ with:153+ use-cross: ${{ matrix.job.use-cross }}154+ command: test155+ args: --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}156+157+ - name: Create tarball158+ id: package159+ shell: bash160+ run: |161+ PKG_suffix=".tar.gz" ; case ${{ matrix.job.target }} in *-pc-windows-*) PKG_suffix=".zip" ;; esac;162+ PKG_BASENAME=${PROJECT_NAME}-v${PROJECT_VERSION}-${{ matrix.job.target }}163+ PKG_NAME=${PKG_BASENAME}${PKG_suffix}164+ echo ::set-output name=PKG_NAME::${PKG_NAME}165+166+ PKG_STAGING="${{ env.CICD_INTERMEDIATES_DIR }}/package"167+ ARCHIVE_DIR="${PKG_STAGING}/${PKG_BASENAME}/"168+ mkdir -p "${ARCHIVE_DIR}"169+ mkdir -p "${ARCHIVE_DIR}/autocomplete"170+171+ # Binary172+ cp "${{ steps.strip.outputs.BIN_PATH }}" "$ARCHIVE_DIR"173+174+ # Man page175+ cp 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'-*/out/assets/manual/'${{ env.PROJECT_NAME }}.1' "$ARCHIVE_DIR"176+177+ # README, LICENSE and CHANGELOG files178+ cp "README.md" "LICENSE-MIT" "LICENSE-APACHE" "CHANGELOG.md" "$ARCHIVE_DIR"179+180+ # Autocompletion files181+ cp 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'-*/out/assets/completions/'${{ env.PROJECT_NAME }}.bash' "$ARCHIVE_DIR/autocomplete/${{ env.PROJECT_NAME }}.bash"182+ cp 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'-*/out/assets/completions/'${{ env.PROJECT_NAME }}.fish' "$ARCHIVE_DIR/autocomplete/${{ env.PROJECT_NAME }}.fish"183+ cp 'contrib/completion_${{ env.PROJECT_NAME }}' "$ARCHIVE_DIR/autocomplete/"184+185+ # base compressed package186+ pushd "${PKG_STAGING}/" >/dev/null187+ case ${{ matrix.job.target }} in188+ *-pc-windows-*) 7z -y a "${PKG_NAME}" "${PKG_BASENAME}"/* | tail -2 ;;189+ *) tar czf "${PKG_NAME}" "${PKG_BASENAME}"/* ;;190+ esac;191+ popd >/dev/null192+193+ # Let subsequent steps know where to find the compressed package194+ echo ::set-output name=PKG_PATH::"${PKG_STAGING}/${PKG_NAME}"195+196+ - name: Create Debian package197+ id: debian-package198+ shell: bash199+ if: startsWith(matrix.job.os, 'ubuntu')200+ run: |201+ COPYRIGHT_YEARS="2018 - "$(date "+%Y")202+ DPKG_STAGING="${{ env.CICD_INTERMEDIATES_DIR }}/debian-package"203+ DPKG_DIR="${DPKG_STAGING}/dpkg"204+ mkdir -p "${DPKG_DIR}"205+206+ DPKG_BASENAME=${PROJECT_NAME}207+ DPKG_CONFLICTS=${PROJECT_NAME}-musl208+ case ${{ matrix.job.target }} in *-musl) DPKG_BASENAME=${PROJECT_NAME}-musl ; DPKG_CONFLICTS=${PROJECT_NAME} ;; esac;209+ DPKG_VERSION=${PROJECT_VERSION}210+211+ unset DPKG_ARCH212+ case ${{ matrix.job.target }} in213+ aarch64-*-linux-*) DPKG_ARCH=arm64 ;;214+ arm-*-linux-*hf) DPKG_ARCH=armhf ;;215+ i686-*-linux-*) DPKG_ARCH=i686 ;;216+ x86_64-*-linux-*) DPKG_ARCH=amd64 ;;217+ *) DPKG_ARCH=notset ;;218+ esac;219+220+ DPKG_NAME="${DPKG_BASENAME}_${DPKG_VERSION}_${DPKG_ARCH}.deb"221+ echo ::set-output name=DPKG_NAME::${DPKG_NAME}222+223+ # Binary224+ install -Dm755 "${{ steps.strip.outputs.BIN_PATH }}" "${DPKG_DIR}/usr/bin/${{ steps.strip.outputs.BIN_NAME }}"225+226+ # Man page227+ install -Dm644 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'-*/out/assets/manual/'${{ env.PROJECT_NAME }}.1' "${DPKG_DIR}/usr/share/man/man1/${{ env.PROJECT_NAME }}.1"228+ gzip -n --best "${DPKG_DIR}/usr/share/man/man1/${{ env.PROJECT_NAME }}.1"229+230+ # Autocompletion files231+ # TODO232+ # install -Dm644 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'-*/out/assets/completions/'${{ env.PROJECT_NAME }}'.fish "${DPKG_DIR}/usr/share/fish/vendor_completions.d/${{ env.PROJECT_NAME }}.fish"233+ # install -Dm644 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'-*/out/assets/completions/'${{ env.PROJECT_NAME }}'.zsh "${DPKG_DIR}/usr/share/zsh/vendor-completions/_${{ env.PROJECT_NAME }}"234+235+ # README and LICENSE236+ install -Dm644 "README.md" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/README.md"237+ install -Dm644 "LICENSE-MIT" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/LICENSE-MIT"238+ install -Dm644 "LICENSE-APACHE" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/LICENSE-APACHE"239+ install -Dm644 "CHANGELOG.md" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/changelog"240+ gzip -n --best "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/changelog"241+242+ cat > "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/copyright" <<EOF243+ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/244+ Upstream-Name: ${{ env.PROJECT_NAME }}245+ Source: ${{ env.PROJECT_HOMEPAGE }}246+247+ Files: *248+ Copyright: ${{ env.PROJECT_MAINTAINER }}249+ Copyright: $COPYRIGHT_YEARS ${{ env.PROJECT_MAINTAINER }}250+ License: Apache-2.0 or MIT251+252+ License: Apache-2.0253+ On Debian systems, the complete text of the Apache-2.0 can be found in the254+ file /usr/share/common-licenses/Apache-2.0.255+256+ License: MIT257+ Permission is hereby granted, free of charge, to any258+ person obtaining a copy of this software and associated259+ documentation files (the "Software"), to deal in the260+ Software without restriction, including without261+ limitation the rights to use, copy, modify, merge,262+ publish, distribute, sublicense, and/or sell copies of263+ the Software, and to permit persons to whom the Software264+ is furnished to do so, subject to the following265+ conditions:266+ .267+ The above copyright notice and this permission notice268+ shall be included in all copies or substantial portions269+ of the Software.270+ .271+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF272+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED273+ TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A274+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT275+ SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY276+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION277+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR278+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER279+ DEALINGS IN THE SOFTWARE.280+ EOF281+ chmod 644 "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/copyright"282+283+ # control file284+ mkdir -p "${DPKG_DIR}/DEBIAN"285+ cat > "${DPKG_DIR}/DEBIAN/control" <<EOF286+ Package: ${DPKG_BASENAME}287+ Version: ${DPKG_VERSION}288+ Section: utils289+ Priority: optional290+ Maintainer: ${{ env.PROJECT_MAINTAINER }}291+ Homepage: ${{ env.PROJECT_HOMEPAGE }}292+ Architecture: ${DPKG_ARCH}293+ Provides: ${{ env.PROJECT_NAME }}294+ Conflicts: ${DPKG_CONFLICTS}295+ Description: cat(1) clone with wings.296+ A cat(1) clone with syntax highlighting and Git integration.297+ EOF298+299+ DPKG_PATH="${DPKG_STAGING}/${DPKG_NAME}"300+ echo ::set-output name=DPKG_PATH::${DPKG_PATH}301+302+ # build dpkg303+ fakeroot dpkg-deb --build "${DPKG_DIR}" "${DPKG_PATH}"304+305+ - name: "Artifact upload: tarball"306+ uses: actions/upload-artifact@master307+ with:308+ name: ${{ steps.package.outputs.PKG_NAME }}309+ path: ${{ steps.package.outputs.PKG_PATH }}310+311+ - name: "Artifact upload: Debian package"312+ uses: actions/upload-artifact@master313+ if: steps.debian-package.outputs.DPKG_NAME314+ with:315+ name: ${{ steps.debian-package.outputs.DPKG_NAME }}316+ path: ${{ steps.debian-package.outputs.DPKG_PATH }}317+318+ - name: Check for release319+ id: is-release320+ shell: bash321+ run: |322+ unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi323+ echo ::set-output name=IS_RELEASE::${IS_RELEASE}324+325+ - name: Publish archives and packages326+ uses: softprops/action-gh-release@v1327+ if: steps.is-release.outputs.IS_RELEASE328+ with:329+ files: |330+ ${{ steps.package.outputs.PKG_PATH }}331+ ${{ steps.debian-package.outputs.DPKG_PATH }}332+ env:333+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}deleted:ci/.gitattributes-1 removed
1-* linguist-vendoreddeleted:ci/before_deploy.bash-179 removed
1-#!/usr/bin/env bash2-# Building and packaging for release3-4-set -ex5-6-build() {7- cargo build --target "$TARGET" --release --verbose8-}9-10-pack() {11- local tempdir12- local out_dir13- local package_name14- local gcc_prefix15-16- tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)17- out_dir=$(pwd)18- package_name="$PROJECT_NAME-$TRAVIS_TAG-$TARGET"19-20- if [[ $TARGET == arm-unknown-linux-* ]]; then21- gcc_prefix="arm-linux-gnueabihf-"22- else23- gcc_prefix=""24- fi25-26- # create a "staging" directory27- mkdir "$tempdir/$package_name"28- mkdir "$tempdir/$package_name/autocomplete"29-30- # copying the main binary31- cp "target/$TARGET/release/$PROJECT_NAME" "$tempdir/$package_name/"32- "${gcc_prefix}"strip "$tempdir/$package_name/$PROJECT_NAME"33-34- # manpage, readme and license35- cp "doc/$PROJECT_NAME.1" "$tempdir/$package_name"36- cp README.md "$tempdir/$package_name"37- cp LICENSE-MIT "$tempdir/$package_name"38- cp LICENSE-APACHE "$tempdir/$package_name"39-40- # various autocomplete41- cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/"$PROJECT_NAME".bash "$tempdir/$package_name/autocomplete/${PROJECT_NAME}.bash-completion"42- cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/"$PROJECT_NAME".fish "$tempdir/$package_name/autocomplete"43- cp contrib/completion/_"$PROJECT_NAME" "$tempdir/$package_name/autocomplete"44-45- # archiving46- pushd "$tempdir"47- tar czf "$out_dir/$package_name.tar.gz" "$package_name"/*48- popd49- rm -r "$tempdir"50-}51-52-make_deb() {53- local tempdir54- local architecture55- local version56- local dpkgname57- local conflictname58- local homepage59- local maintainer60- local gcc_prefix61-62- homepage="https://github.com/sharkdp/fd"63- maintainer="David Peter <mail@david-peter.de>"64-65- case $TARGET in66- x86_64*)67- architecture=amd6468- gcc_prefix=""69- ;;70- i686*)71- architecture=i38672- gcc_prefix=""73- ;;74- arm*hf)75- architecture=armhf76- gcc_prefix="arm-linux-gnueabihf-"77- ;;78- *)79- echo "make_deb: skipping target '${TARGET}'" >&280- return 081- ;;82- esac83- version=${TRAVIS_TAG#v}84- if [[ $TARGET = *musl* ]]; then85- dpkgname=$PROJECT_NAME-musl86- conflictname=$PROJECT_NAME87- else88- dpkgname=$PROJECT_NAME89- conflictname=$PROJECT_NAME-musl90- fi91-92- tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)93-94- # copy the main binary95- install -Dm755 "target/$TARGET/release/$PROJECT_NAME" "$tempdir/usr/bin/$PROJECT_NAME"96- "${gcc_prefix}"strip "$tempdir/usr/bin/$PROJECT_NAME"97-98- # manpage99- install -Dm644 "doc/$PROJECT_NAME.1" "$tempdir/usr/share/man/man1/$PROJECT_NAME.1"100- gzip --best "$tempdir/usr/share/man/man1/$PROJECT_NAME.1"101-102- # readme and license103- install -Dm644 README.md "$tempdir/usr/share/doc/$PROJECT_NAME/README.md"104- install -Dm644 LICENSE-MIT "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE-MIT"105- install -Dm644 LICENSE-APACHE "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE-APACHE"106- cat > "$tempdir/usr/share/doc/$PROJECT_NAME/copyright" <<EOF107-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/108-Upstream-Name: $PROJECT_NAME109-Source: $homepage110-111-Files: *112-Copyright: $maintainer113-License: Apache-2.0 or MIT114-115-License: Apache-2.0116- On Debian systems, the complete text of the Apache-2.0 can be found in the117- file /usr/share/common-licenses/Apache-2.0.118-119-License: MIT120- Permission is hereby granted, free of charge, to any121- person obtaining a copy of this software and associated122- documentation files (the "Software"), to deal in the123- Software without restriction, including without124- limitation the rights to use, copy, modify, merge,125- publish, distribute, sublicense, and/or sell copies of126- the Software, and to permit persons to whom the Software127- is furnished to do so, subject to the following128- conditions:129- .130- The above copyright notice and this permission notice131- shall be included in all copies or substantial portions132- of the Software.133- .134- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF135- ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED136- TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A137- PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT138- SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY139- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION140- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR141- IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER142- DEALINGS IN THE SOFTWARE.143-EOF144-145- # completions146- install -Dm644 target/$TARGET/release/build/$PROJECT_NAME-*/out/$PROJECT_NAME.bash "$tempdir/usr/share/bash-completion/completions/${PROJECT_NAME}"147- install -Dm644 target/$TARGET/release/build/$PROJECT_NAME-*/out/$PROJECT_NAME.fish "$tempdir/usr/share/fish/completions/$PROJECT_NAME.fish"148- install -Dm644 contrib/completion/_"$PROJECT_NAME" "$tempdir/usr/share/zsh/vendor-completions/_$PROJECT_NAME"149-150- # Control file151- mkdir "$tempdir/DEBIAN"152- cat > "$tempdir/DEBIAN/control" <<EOF153-Package: $dpkgname154-Version: $version155-Section: utils156-Priority: optional157-Maintainer: $maintainer158-Architecture: $architecture159-Provides: $PROJECT_NAME160-Conflicts: $conflictname161-Homepage: $homepage162-Description: Simple, fast and user-friendly alternative to find163- While fd does not seek to mirror all of find's powerful functionality, it164- provides sensible (opinionated) defaults for 80% of the use cases.165-EOF166-167- fakeroot dpkg-deb --build "$tempdir" "${dpkgname}_${version}_${architecture}.deb"168-}169-170-171-main() {172- build173- pack174- if [[ $TARGET = *linux* ]]; then175- make_deb176- fi177-}178-179-maindeleted:ci/before_install.bash-26 removed
1234567891011121314151617181920212223242526#!/usr/bin/env bash
set -ex
if [ "$TRAVIS_OS_NAME" != linux ]; then exit 0fi
sudo apt-get update
# needed to build deb packagessudo apt-get install -y fakeroot
# needed for i686 linux gnu targetif [[ $TARGET == i686-unknown-linux-gnu ]]; then sudo apt-get install -y gcc-multilibfi
# needed for cross-compiling for armif [[ $TARGET == arm-unknown-linux-* ]]; then sudo apt-get install -y \ gcc-4.8-arm-linux-gnueabihf \ binutils-arm-linux-gnueabihf \ libc6-armhf-cross \ libc6-dev-armhf-crossfideleted:ci/script.bash-11 removed
1234567891011#!/usr/bin/env bash
set -ex
# Incorporate TARGET env var to the build and test processcargo build --target "$TARGET" --verbose
# We cannot run arm executables on linuxif [[ $TARGET != arm-unknown-linux-* ]]; then cargo test --target "$TARGET" --verbosefideleted:.travis.yml-104 removed
1-language: rust2-jobs:3- include:4- # Stable channel.5- - os: linux6- rust: stable7- env: TARGET=x86_64-unknown-linux-gnu8- - os: linux9- rust: stable10- env: TARGET=x86_64-unknown-linux-musl11- - os: linux12- rust: stable13- env: TARGET=i686-unknown-linux-gnu14- - os: linux15- rust: stable16- env: TARGET=i686-unknown-linux-musl17- - os: osx18- osx_image: xcode11.4 # Catalina19- rust: stable20- env: TARGET=x86_64-apple-darwin21- - os: linux22- rust: stable23- env:24- - TARGET=arm-unknown-linux-gnueabihf25- - CC_arm_unknown_linux_gnueabihf=/usr/bin/arm-linux-gnueabihf-gcc-4.826- - CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc-4.827- - os: linux28- rust: stable29- env:30- - TARGET=arm-unknown-linux-musleabihf31- - CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER=arm-linux-gnueabihf-gcc-4.832-33- # Beta channel.34- - os: linux35- rust: beta36- env: TARGET=x86_64-unknown-linux-gnu37-38- # Minimum Rust supported channel.39- - os: linux40- rust: 1.40.041- env: TARGET=x86_64-unknown-linux-gnu42- - os: linux43- rust: 1.40.044- env: TARGET=x86_64-unknown-linux-musl45- - os: linux46- rust: 1.40.047- env: TARGET=i686-unknown-linux-gnu48- - os: linux49- rust: 1.40.050- env: TARGET=i686-unknown-linux-musl51- - os: osx52- rust: 1.40.053- env: TARGET=x86_64-apple-darwin54-55-before_install:56- - ci/before_install.bash57-58-env:59- global:60- # Default target on travis-ci.61- # Used as conditional check in the install stage62- - HOST=x86_64-unknown-linux-gnu63- # Used on the deployment script64- - PROJECT_NAME=fd65-66-install:67- # prevent target re-add error from rustup68- - if [[ $TRAVIS_OS_NAME = linux && $HOST != $TARGET ]]; then rustup target add $TARGET; fi69-70-script:71- - ci/script.bash72-73-before_deploy:74- - bash ci/before_deploy.bash75-76-deploy:77- provider: releases78- # NOTE updating the `token.secure`79- # - go to: https://github.com/settings/tokens/new80- # - generate new token using `public_repo` scope81- # - encrypt it using: `travis encrypt API_KEY_HERE`82- # - paste the output below83- token:84- secure: "RyFdh2lpDmaNhPar7ezsb18Xz+6XFM40y7cZCDRML+Sk+eYK1xtDNfEhDRJU5Qo1ReVsByds/QJTSXr2KmZPk3lXwG3SiN7UtrLUxCxFr6qrcM/iujlKTf5UxeRklkzPXxnH95DEyEgxvgbVhWTGVDWoyMnrVQXZKDy6z1iAiYB5h2Zl1rs+MRb/Enlt5q6XIKAlG0ppGtl8CfYudq5ZiqfJaMWTt9SWm2YskC8FeMc0S3IM6/EhTvaNYLdaarFqVWQEVql+6oCuL3ayPzmGyxLdxM37tIMNQ0f97zxqWodacXTG5ULdRD8if1l/SmTujrtjbZ0KWRjsjOq4vBtxBJKGdprcSiB0xH/hToqqtTSO0z5FPXi5cB8UlK6YLDDHcP3kXNer8CYMLI1VPaUDLTF57/0/RPi2DZiiGfZsIAS6PsICbHdTQVzxQckM4lN1vnAGgkhXIMbztml21pv+QrGy98OZJ0ubf5ztgQhpT0WPH4JXT8M6htsoo8dZf8lQ5aLfmW9RKePJDqixQwPqmimPIkrlxRDTDGII0ZAZws7l779eOLmEcM2tH2HbsUKUCZIG/pRHLSlP45Jn2bULGzuXZ2daq70z6zvIbom0CUzSXIvdTXEZI2AM5RBvPYGGaKI8YlxgRdQvJp3h0BzPdFOXI3RAxscCY7PJpa/RdIg="85- # for uploading multiple files86- file_glob: true87- # NOTE explanation on each env variable88- # - PROJECT_NAME: name of the project, set on the `env.global` above89- # - TRAVIS_TAG: tag name that the build is being deployed for, usually the version number90- # - TARGET: target triple of the build91- file:92- - $PROJECT_NAME-$TRAVIS_TAG-$TARGET.*93- - $PROJECT_NAME*.deb94- # don't delete artifacts from previous stage95- skip_cleanup: true96- on:97- # deploy only if we push a tag98- tags: true99- # deploy only on stable channel that has TARGET env variable sets100- condition: $TRAVIS_RUST_VERSION = stable && $TARGET != ""101-102-notifications:103- email:104- on_success: neverdeleted:appveyor.yml-71 removed
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071# Source: https://github.com/starkat99/appveyor-rust/
environment: global: PROJECT_NAME: fd matrix: # Stable channel - TARGET: i686-pc-windows-gnu CHANNEL: stable - TARGET: i686-pc-windows-msvc CHANNEL: stable - TARGET: x86_64-pc-windows-gnu CHANNEL: stable - TARGET: x86_64-pc-windows-msvc CHANNEL: stable
# Install Rust and Cargo# (Based on from https://github.com/rust-lang/libc/blob/master/appveyor.yml)install: - curl -sSf -o rustup-init.exe https://win.rustup.rs - rustup-init.exe --default-host %TARGET% --default-toolchain %CHANNEL% -y - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin - rustc -Vv - cargo -V
# 'cargo test' takes care of building for us, so disable Appveyor's build stage. This prevents# the "directory does not contain a project or solution file" error.# source: https://github.com/starkat99/appveyor-rust/blob/master/appveyor.yml#L113build: false
# Equivalent to Travis' `script` phasetest_script: - cargo build --verbose - cargo run - cargo test
before_deploy: # Generate artifacts for release - cargo build --release - mkdir staging - copy target\release\fd.exe staging - ps: copy target\release\build\fd-find*\out\_fd.ps1 staging - cd staging # release zipfile will look like 'rust-everywhere-v1.2.3-x86_64-pc-windows-msvc' - 7z a ../%PROJECT_NAME%-%APPVEYOR_REPO_TAG_NAME%-%TARGET%.zip * - appveyor PushArtifact ../%PROJECT_NAME%-%APPVEYOR_REPO_TAG_NAME%-%TARGET%.zip
deploy: description: 'Windows release' # All the zipped artifacts will be deployed artifact: /.*\.zip/ # Here's how: # - Go to 'https://github.com/settings/tokens/new' and generate a Token with only the # `public_repo` scope enabled # - Then go to 'https://ci.appveyor.com/tools/encrypt' and enter the newly generated token. # - Enter the "encrypted value" below auth_token: secure: mWJ8ieZdGEgHf232fdMyzb9T1rKbkJivYbp/REMo8ax3X5vkQJDHhFjWeuWA3wIC provider: GitHub # deploy when a new tag is pushed and only on the stable channel on: # channel to use to produce the release artifacts CHANNEL: stable appveyor_repo_tag: true
branches: only: - master # IMPORTANT Regex to match tags. Required, or appveyor may not trigger deploys when a new tag # is pushed. This regex matches semantic versions like v1.2.3-rc4+2016.02.22 - /^v\d+\.\d+\.\d+.*$/No newline at end of file