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 61b26a1 · Browse files · 7 files·+333 added−381 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−381 removed
- other:+333 added−381 removed
Provenance
- Commit
1aefe14- Tree
5a678ff- Author
David Peter <mail@david-peter.de>- Committer
David Peter <sharkdp@users.noreply.github.com>- Parent
61b26a1
7 files changed+333 added−381 removed
added:.github/workflows/CICD.yml+333 added
1+name: CICD2+3+env:4+ MIN_SUPPORTED_RUST_VERSION: "1.46.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-*) 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=hyperfine" >> $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-*) 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+ unset CARGO_TEST_OPTIONS146+ unset CARGO_TEST_OPTIONS ; case ${{ matrix.job.target }} in arm-* | aarch64-*) CARGO_TEST_OPTIONS="--bin ${PROJECT_NAME}" ;; esac;147+ echo ::set-output name=CARGO_TEST_OPTIONS::${CARGO_TEST_OPTIONS}148+149+ - name: Run tests150+ uses: actions-rs/cargo@v1151+ with:152+ use-cross: ${{ matrix.job.use-cross }}153+ command: test154+ args: --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}155+156+ - name: Create tarball157+ id: package158+ shell: bash159+ run: |160+ PKG_suffix=".tar.gz" ; case ${{ matrix.job.target }} in *-pc-windows-*) PKG_suffix=".zip" ;; esac;161+ PKG_BASENAME=${PROJECT_NAME}-v${PROJECT_VERSION}-${{ matrix.job.target }}162+ PKG_NAME=${PKG_BASENAME}${PKG_suffix}163+ echo ::set-output name=PKG_NAME::${PKG_NAME}164+165+ PKG_STAGING="${{ env.CICD_INTERMEDIATES_DIR }}/package"166+ ARCHIVE_DIR="${PKG_STAGING}/${PKG_BASENAME}/"167+ mkdir -p "${ARCHIVE_DIR}"168+ mkdir -p "${ARCHIVE_DIR}/autocomplete"169+170+ # Binary171+ cp "${{ steps.strip.outputs.BIN_PATH }}" "$ARCHIVE_DIR"172+173+ # Man page174+ cp 'doc/${{ env.PROJECT_NAME }}.1' "$ARCHIVE_DIR"175+176+ # README, LICENSE and CHANGELOG files177+ cp "README.md" "LICENSE-MIT" "LICENSE-APACHE" "CHANGELOG.md" "$ARCHIVE_DIR"178+179+ # Autocompletion files180+ cp 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'*/out/'${{ env.PROJECT_NAME }}.bash' "$ARCHIVE_DIR/autocomplete/"181+ cp 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'*/out/'${{ env.PROJECT_NAME }}.fish' "$ARCHIVE_DIR/autocomplete/"182+ cp 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'*/out/'_${{ env.PROJECT_NAME }}.ps1' "$ARCHIVE_DIR/autocomplete/"183+ cp 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'*/out/'_${{ 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 'doc/${{ 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+ install -Dm644 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'*/out/'${{ env.PROJECT_NAME }}.bash' "${DPKG_DIR}/usr/share/bash-completion/completions/${{ env.PROJECT_NAME }}"232+ install -Dm644 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'*/out/'${{ 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/'_${{ env.PROJECT_NAME }}' "${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-177 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 target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/_"$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/$PROJECT_NAME"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 target/$TARGET/release/build/$PROJECT_NAME-*/out/_$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: A command-line benchmarking tool.163-EOF164-165- fakeroot dpkg-deb --build "$tempdir" "${dpkgname}_${version}_${architecture}.deb"166-}167-168-169-main() {170- build171- pack172- if [[ $TARGET = *linux* ]]; then173- make_deb174- fi175-}176-177-maindeleted:ci/before_deploy.ps1-27 removed
1-# This script takes care of packaging the build artifacts that will go in the2-# release zipfile3-4-$SRC_DIR = $PWD.Path5-$STAGE = [System.Guid]::NewGuid().ToString()6-7-Set-Location $ENV:Temp8-New-Item -Type Directory -Name $STAGE9-Set-Location $STAGE10-11-$ZIP = "$SRC_DIR\$($Env:CRATE_NAME)-$($Env:APPVEYOR_REPO_TAG_NAME)-$($Env:TARGET).zip"12-13-Copy-Item "$SRC_DIR\target\release\hyperfine.exe" '.\'14-15-# readme and license16-Copy-Item $SRC_DIR\README.md '.\'17-Copy-Item $SRC_DIR\LICENSE-MIT '.\'18-Copy-Item $SRC_DIR\LICENSE-APACHE '.\'19-Copy-Item "$SRC_DIR\target\release\build\hyperfine-*\out\_hyperfine.ps1" '.\'20-21-7z a "$ZIP" *22-23-Push-AppveyorArtifact "$ZIP"24-25-Set-Location ..26-Remove-Item $STAGE -Force -Recurse27-Set-Location $SRC_DIRdeleted: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-* ]]; 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:.travis.yml-100 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- rust: stable19- env: TARGET=x86_64-apple-darwin20- - os: linux21- rust: stable22- env:23- - TARGET=arm-unknown-linux-gnueabihf24- - CC_arm_unknown_linux_gnueabihf=/usr/bin/arm-linux-gnueabihf-gcc-4.825- - CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc-4.826- - os: linux27- rust: stable28- env:29- - TARGET=arm-unknown-linux-musleabihf30- - CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER=arm-linux-gnueabihf-gcc-4.831-32- # Minimum Rust supported channel.33- - os: linux34- rust: 1.46.035- env: TARGET=x86_64-unknown-linux-gnu36- - os: linux37- rust: 1.46.038- env: TARGET=x86_64-unknown-linux-musl39- - os: linux40- rust: 1.46.041- env: TARGET=i686-unknown-linux-gnu42- - os: linux43- rust: 1.46.044- env: TARGET=i686-unknown-linux-musl45- - os: osx46- rust: 1.46.047- env: TARGET=x86_64-apple-darwin48-49-before_install:50- - ci/before_install.bash51-52-env:53- global:54- # Default target on travis-ci.55- # Used as conditional check in the install stage56- - HOST=x86_64-unknown-linux-gnu57- # Used on the deployment script58- - PROJECT_NAME=hyperfine59-60-install:61- # prevent target re-add error from rustup62- - if [[ $TRAVIS_OS_NAME = linux && $HOST != $TARGET ]]; then rustup target add $TARGET; fi63-64-script:65- # Incorporate TARGET env var to the build and test process66- - cargo build --target $TARGET --verbose67- - '[[ $TARGET == arm-unknown-linux-* ]] || cargo test --target $TARGET --verbose'68-69-before_deploy:70- - bash ci/before_deploy.bash71-72-deploy:73- provider: releases74- # NOTE updating the `token.secure`75- # - go to: https://github.com/settings/tokens/new76- # - generate new token using `public_repo` scope77- # - encrypt it using: `travis encrypt API_KEY_HERE`78- # - paste the output below79- token:80- secure: "U9QfCOQkeozaDNrTV6i2vRocX2puB5p1WSN+w9t/1j33rAtXx6ZhFx67A8nl0+dQ9nvPu/RIsFWXrYzfHQskL1WulKNHm0S5otN+747dEzbSIfMNi1UfysyCiM1SNPq+FX3qOkva83+Fe2Lyd1g4gQObceE4xsgfplfzdm+ebIa6CrfKOypToEuetzP/r8V0WpW4Cp8ojQwvsL1nfHjr1gmvmr443Gr9Yvgq9SS/NAHldrpaJr8mD26W/7jbHdm3lvrNwqLbthYDUTPZsO+2B44h+T/tuhVYbur4fel1KMo4mkIwZwsSKvJbf3Q6Vdcc9dZM+niZU78UGLt0JNEMQNqQLPGYqh+TlFR2B++lcYlybT3LcUaSkt0YIX7C4DAbMLS6sl5Fq2pRNuM/eY2BWdHf0I+K19PDxUEliUifsfSQ3rbfl52aKKLcJa0WPyDJt0qldElagxOaTIk/jn1kKkdkQu9M4gVzKXImIauRQih3CLER7th8ADMxW5Plgq8fvffJBTKlubUznKrGeeR3Mjm8DsRjhkIvFO0Doqmki4sd5zE/BOFI5a/SHg73ms+bLXLuKFK+YzIlHszCHolzkAT44aq7+LEudk8jt+QVtBEocCN/4ew4Q9Qh2tcn22+hU3Aw88lO95PsbZzTzoFtX4X89Sl1fGtpkHFZvvL4ZT0="81- # for uploading multiple files82- file_glob: true83- # NOTE explanation on each env variable84- # - PROJECT_NAME: name of the project, set on the `env.global` above85- # - TRAVIS_TAG: tag name that the build is being deployed for, usually the version number86- # - TARGET: target triple of the build87- file:88- - $PROJECT_NAME-$TRAVIS_TAG-$TARGET.*89- - $PROJECT_NAME*.deb90- # don't delete artifacts from previous stage91- skip_cleanup: true92- on:93- # deploy only if we push a tag94- tags: true95- # deploy only on stable channel that has TARGET env variable sets96- condition: $TRAVIS_RUST_VERSION = stable && $TARGET != ""97-98-notifications:99- email:100- on_success: neverdeleted:appveyor.yml-50 removed
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950environment: global: TARGET: x86_64-pc-windows-msvc RUST_VERSION: stable CRATE_NAME: hyperfine CARGO_HOME: "c:\\cargo" RUSTUP_HOME: "c:\\rustup"
install: - appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe - rustup-init.exe -y --default-host %TARGET% - set PATH=%PATH%;C:\cargo\bin - rustc -Vv - cargo -V
build: falsetest_script: - cargo test --target %TARGET% --verbose - cargo run --target %TARGET% -- --help - cargo run --target %TARGET% -- "echo hello"
before_deploy: # Generate artifacts for release - cargo build --release --verbose - ps: ci\before_deploy.ps1
deploy: description: 'Automatically deployed release' 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: oO4/J+hcFXgXcEqEc8gzlQNqLG0IxU78s4EyH+uczGdsyWajb3yipxPR6nXUvmoj provider: GitHub on: RUST_VERSION: stable appveyor_repo_tag: true
cache: - C:\Users\appveyor\.cargo\registry - target
notifications: - provider: Email on_build_success: false on_build_failure: false on_build_status_changed: false