@@ -2,17 +2,18 @@ name: CICD
4 PROJECT_NAME: bat
4 PROJECT_NAME: bat
5+ PROJECT_VERSION: "0.17.1"
5 PROJECT_DESC: "A `cat` clone with wings"
6 PROJECT_DESC: "A `cat` clone with wings"
6 PROJECT_MAINTAINER: "David Peter <mail@david-peter.de>"
7 PROJECT_MAINTAINER: "David Peter <mail@david-peter.de>"
7 PROJECT_HOMEPAGE: "https://github.com/sharkdp/bat"
8 PROJECT_HOMEPAGE: "https://github.com/sharkdp/bat"
8− MIN_SUPPORTED_RUST_VERSION: "1.40.0"
9+ MIN_SUPPORTED_RUST_VERSION: "1.42.0"
10on: [push, pull_request]
11on: [push, pull_request]
13 min_version:
14 min_version:
14 name: Minimum supported rust version
15 name: Minimum supported rust version
15− runs-on: ubuntu-latest
16+ runs-on: ubuntu-18.04
17 - name: Git checkout
18 - name: Git checkout
18 uses: actions/checkout@v2
19 uses: actions/checkout@v2
@@ -27,7 +28,7 @@ jobs:
27 uses: actions-rs/cargo@v1
28 uses: actions-rs/cargo@v1
29 command: clippy
30 command: clippy
30− args: --all-targets --all-features -- --allow clippy::style
31+ args: --all-targets --all-features
31 - name: Test
32 - name: Test
32 uses: actions-rs/cargo@v1
33 uses: actions-rs/cargo@v1
@@ -35,7 +36,7 @@ jobs:
36 test_with_new_syntaxes_and_themes:
37 test_with_new_syntaxes_and_themes:
37 name: Test with new syntaxes and themes
38 name: Test with new syntaxes and themes
38− runs-on: ubuntu-latest
39+ runs-on: ubuntu-18.04
40 - name: Git checkout
41 - name: Git checkout
41 uses: actions/checkout@v2
42 uses: actions/checkout@v2
@@ -83,19 +84,17 @@ jobs:
83 fail-fast: false
84 fail-fast: false
86− # { os, target, cargo-options, features, use-cross }
87− - { os: ubuntu-latest , target: arm-unknown-linux-gnueabihf , use-cross: true }
87+ - { os: ubuntu-18.04 , target: arm-unknown-linux-gnueabihf , use-cross: true }
88− - { os: ubuntu-18.04 , target: aarch64-unknown-linux-gnu , use-cross: true }
88+ - { os: ubuntu-18.04 , target: aarch64-unknown-linux-gnu , use-cross: true }
89− - { os: ubuntu-18.04 , target: i686-unknown-linux-gnu , use-cross: true }
89+ - { os: ubuntu-18.04 , target: i686-unknown-linux-gnu , use-cross: true }
90− - { os: ubuntu-18.04 , target: i686-unknown-linux-musl , use-cross: true }
90+ - { os: ubuntu-18.04 , target: i686-unknown-linux-musl , use-cross: true }
91− - { os: ubuntu-18.04 , target: x86_64-unknown-linux-gnu }
91+ - { os: ubuntu-18.04 , target: x86_64-unknown-linux-gnu }
92− - { os: ubuntu-18.04 , target: x86_64-unknown-linux-musl , use-cross: true }
92+ - { os: ubuntu-18.04 , target: x86_64-unknown-linux-musl , use-cross: true }
93− - { os: ubuntu-16.04 , target: x86_64-unknown-linux-gnu }
94− - { os: macos-latest , target: x86_64-apple-darwin }
93+ - { os: macos-10.15 , target: x86_64-apple-darwin }
95− # - { os: windows-latest , target: i686-pc-windows-gnu } ## disabled; error: linker `i686-w64-mingw32-gcc` not found
94+ # - { os: windows-2019 , target: i686-pc-windows-gnu } ## disabled; error: linker `i686-w64-mingw32-gcc` not found
96− - { os: windows-latest , target: i686-pc-windows-msvc }
95+ - { os: windows-2019 , target: i686-pc-windows-msvc }
97− - { os: windows-latest , target: x86_64-pc-windows-gnu }
96+ - { os: windows-2019 , target: x86_64-pc-windows-gnu }
98− - { os: windows-latest , target: x86_64-pc-windows-msvc }
97+ - { os: windows-2019 , target: x86_64-pc-windows-msvc }
100 - name: Git checkout
99 - name: Git checkout
101 uses: actions/checkout@v2
100 uses: actions/checkout@v2
@@ -116,26 +115,14 @@ jobs:
116 # determine EXE suffix
115 # determine EXE suffix
117 EXE_suffix="" ; case ${{ matrix.job.target }} in *-pc-windows-*) EXE_suffix=".exe" ;; esac;
116 EXE_suffix="" ; case ${{ matrix.job.target }} in *-pc-windows-*) EXE_suffix=".exe" ;; esac;
118 echo ::set-output name=EXE_suffix::${EXE_suffix}
117 echo ::set-output name=EXE_suffix::${EXE_suffix}
119− # parse commit reference info
120− unset REF_TAG ; case ${GITHUB_REF} in refs/tags/*) REF_TAG=${GITHUB_REF#refs/tags/} ;; esac;
121− REF_SHAS=${GITHUB_SHA:0:8}
123− unset TARGET_ARCH ; case ${{ matrix.job.target }} in arm-unknown-linux-gnueabihf) TARGET_ARCH=arm ;; i686-*) TARGET_ARCH=i686 ;; x86_64-*) TARGET_ARCH=x86_64 ;; esac;
124− echo ::set-output name=TARGET_ARCH::${TARGET_ARCH}
125− unset TARGET_OS ; case ${{ matrix.job.target }} in *-linux-*) TARGET_OS=linux ;; *-apple-*) TARGET_OS=macos ;; *-windows-*) TARGET_OS=windows ;; esac;
126− echo ::set-output name=TARGET_OS::${TARGET_OS}
127 # package name
118 # package name
128 PKG_suffix=".tar.gz" ; case ${{ matrix.job.target }} in *-pc-windows-*) PKG_suffix=".zip" ;; esac;
119 PKG_suffix=".tar.gz" ; case ${{ matrix.job.target }} in *-pc-windows-*) PKG_suffix=".zip" ;; esac;
129− PKG_BASENAME=${PROJECT_NAME}-${REF_TAG:-$REF_SHAS}-${{ matrix.job.target }}
120+ PKG_BASENAME=${PROJECT_NAME}-v${PROJECT_VERSION}-${{ matrix.job.target }}
130 PKG_NAME=${PKG_BASENAME}${PKG_suffix}
121 PKG_NAME=${PKG_BASENAME}${PKG_suffix}
131− echo ::set-output name=PKG_suffix::${PKG_suffix}
132 echo ::set-output name=PKG_BASENAME::${PKG_BASENAME}
122 echo ::set-output name=PKG_BASENAME::${PKG_BASENAME}
133 echo ::set-output name=PKG_NAME::${PKG_NAME}
123 echo ::set-output name=PKG_NAME::${PKG_NAME}
134− # deployable tag? (ie, leading "vM" or "M"; M == version number)
124+ unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi
135− unset DEPLOY ; if [[ $REF_TAG =~ ^[vV]?[0-9].* ]]; then DEPLOY='true' ; fi
136− # unset deploy on ubuntu-18.04 x64 - we will deploy the tarball/deb built on ubuntu-16.04 x64
137− if [ "${{ matrix.job.os }}" = "ubuntu-18.04" ] && [ "${{ matrix.job.target }}" = "x86_64-unknown-linux-gnu" ]; then unset DEPLOY; fi
138− echo ::set-output name=DEPLOY::${DEPLOY}
125+ echo ::set-output name=IS_RELEASE::${IS_RELEASE}
139 # DPKG architecture?
126 # DPKG architecture?
140 unset DPKG_ARCH
127 unset DPKG_ARCH
141 case ${{ matrix.job.target }} in
128 case ${{ matrix.job.target }} in
@@ -145,8 +132,7 @@ jobs:
145 x86_64-*-linux-*) DPKG_ARCH=amd64 ;;
132 x86_64-*-linux-*) DPKG_ARCH=amd64 ;;
147 echo ::set-output name=DPKG_ARCH::${DPKG_ARCH}
134 echo ::set-output name=DPKG_ARCH::${DPKG_ARCH}
148− # DPKG version?
135+ DPKG_VERSION=${PROJECT_VERSION}
149− unset DPKG_VERSION ; if [[ $REF_TAG =~ ^[vV]?[0-9].* ]]; then DPKG_VERSION=${REF_TAG/#[vV]/} ; fi
150 echo ::set-output name=DPKG_VERSION::${DPKG_VERSION}
136 echo ::set-output name=DPKG_VERSION::${DPKG_VERSION}
151 # DPKG base name/conflicts?
137 # DPKG base name/conflicts?
152 DPKG_BASENAME=${PROJECT_NAME}
138 DPKG_BASENAME=${PROJECT_NAME}
@@ -159,10 +145,6 @@ jobs:
159 if [[ -n $DPKG_ARCH && -n $DPKG_VERSION ]]; then DPKG_NAME="${DPKG_BASENAME}_${DPKG_VERSION}_${DPKG_ARCH}.deb" ; fi
145 if [[ -n $DPKG_ARCH && -n $DPKG_VERSION ]]; then DPKG_NAME="${DPKG_BASENAME}_${DPKG_VERSION}_${DPKG_ARCH}.deb" ; fi
160 echo ::set-output name=DPKG_NAME::${DPKG_NAME}
146 echo ::set-output name=DPKG_NAME::${DPKG_NAME}
161 # target-specific options
147 # target-specific options
162− # # * `arm` cannot be tested on ubuntu-* hosts (b/c testing is currently primarily done via comparison of target outputs with built-in outputs and the `arm` target is not executable on the host)
163− JOB_DO_TESTING="true"
164− case ${{ matrix.job.target }} in arm-*) unset JOB_DO_TESTING ;; esac;
165− echo ::set-output name=JOB_DO_TESTING::${JOB_DO_TESTING}
166 # # * test only library unit tests and binary for arm-type targets
148 # # * test only library unit tests and binary for arm-type targets
167 unset CARGO_TEST_OPTIONS
149 unset CARGO_TEST_OPTIONS
168 unset CARGO_TEST_OPTIONS ; case ${{ matrix.job.target }} in arm-* | aarch64-*) CARGO_TEST_OPTIONS="--lib --bin ${PROJECT_NAME}" ;; esac;
150 unset CARGO_TEST_OPTIONS ; case ${{ matrix.job.target }} in arm-* | aarch64-*) CARGO_TEST_OPTIONS="--lib --bin ${PROJECT_NAME}" ;; esac;
@@ -241,11 +223,6 @@ jobs:
241 use-cross: ${{ matrix.job.use-cross }}
223 use-cross: ${{ matrix.job.use-cross }}
242 command: check
224 command: check
243 args: --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git,paging
225 args: --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git,paging
244− - name: Upload build artifacts
245− uses: actions/upload-artifact@master
247− name: ${{ env.PROJECT_NAME }}-${{ matrix.job.target }}
248− path: target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}
249 - name: Package
226 - name: Package
250 shell: bash
227 shell: bash
@@ -358,9 +335,20 @@ jobs:
358 # build dpkg
335 # build dpkg
359 fakeroot dpkg-deb --build "${DPKG_DIR}" "${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.DPKG_NAME }}"
336 fakeroot dpkg-deb --build "${DPKG_DIR}" "${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.DPKG_NAME }}"
338+ - name: Upload package artifact
339+ uses: actions/upload-artifact@master
341+ name: ${{ steps.vars.outputs.PKG_NAME }}
342+ path: ${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_NAME }}
343+ - name: Upload Debian package artifact
344+ uses: actions/upload-artifact@master
345+ if: steps.vars.outputs.DPKG_NAME
347+ name: ${{ steps.vars.outputs.DPKG_NAME }}
348+ path: ${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.DPKG_NAME }}
361 - name: Publish archives and packages
349 - name: Publish archives and packages
362 uses: softprops/action-gh-release@v1
350 uses: softprops/action-gh-release@v1
363− if: steps.vars.outputs.DEPLOY
351+ if: steps.vars.outputs.IS_RELEASE
366 ${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_NAME }}
354 ${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_NAME }}
@@ -375,11 +363,10 @@ jobs:
375 strategy:
363 strategy:
376 fail-fast: true
364 fail-fast: true
378− # job: [ { os: ubuntu-latest }, { os: macos-latest }, { os: windows-latest } ]
380− - { os: ubuntu-latest , toolchain: nightly-2020-04-29 }
367+ - { os: ubuntu-18.04 , toolchain: nightly-2020-04-29 }
381− - { os: macos-latest , toolchain: nightly-2020-04-29 }
368+ - { os: macos-10.15 , toolchain: nightly-2020-04-29 }
382− - { os: windows-latest , toolchain: nightly-2020-04-29-x86_64-pc-windows-gnu }
369+ - { os: windows-2019 , toolchain: nightly-2020-04-29-x86_64-pc-windows-gnu }
384 - uses: actions/checkout@v2
371 - uses: actions/checkout@v2
385 - name: Initialize workflow variables
372 - name: Initialize workflow variables