git.delta.rocks / jrsonnet / refs/commits / 1f5d87f33b16

difftreelog

source

.github/workflows/release.yml5.0 KiBsourcehistory
1name: CI2on: [push]3jobs:4  test:5    name: Test Suite6    runs-on: ubuntu-latest7    steps:8      - name: Checkout sources9        uses: actions/checkout@v210      - name: Install stable toolchain11        uses: actions-rs/toolchain@v112        with:13          toolchain: stable14          override: true15      - name: Run tests16        uses: actions-rs/cargo@v117        with:18          command: test19          args: --all2021  cargo-release:22    if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref, '-test')23    needs: [test]24    runs-on: ubuntu-latest25    steps:26      - name: Checkout sources27        uses: actions/checkout@v228      - name: Install stable toolchain29        uses: actions-rs/toolchain@v130        with:31          toolchain: stable32          override: true33      - name: Install cargo release command34        uses: actions-rs/cargo@v135        with:36          command: install37          args: cargo-release38      - name: Run cargo login39        uses: actions-rs/cargo@v140        with:41          command: login42          args: ${{ secrets.CARGO_TOKEN }}43      - name: Publish crates44        uses: actions-rs/cargo@v145        with:46          command: release47          args: --no-dev-version --skip-push --skip-tag --no-confirm4849  github-release:50    if: startsWith(github.ref, 'refs/tags/')51    needs: [test]52    strategy:53      matrix:54        target:55          # Linux build notes:56          # While musl targets are not as supported as gnu, those are most relevant to users,57          # which want to download binaries from github, as glibc has compatibility issues58          # with older distros5960          # Tier 161          - i686-pc-windows-msvc62          - x86_64-apple-darwin63          - x86_64-pc-windows-msvc6465          # Tier 266          - aarch64-apple-darwin67          - aarch64-unknown-linux-musl68          - i686-unknown-linux-musl69          - x86_64-unknown-linux-musl70        include:71          # Linux72          - target: aarch64-unknown-linux-musl73            os: ubuntu-latest74            bin: jrsonnet75            name: jrsonnet-linux-aarch6476          - target: i686-unknown-linux-musl77            os: ubuntu-latest78            bin: jrsonnet79            name: jrsonnet-linux-i68680          - target: x86_64-unknown-linux-musl81            os: ubuntu-latest82            bin: jrsonnet83            name: jrsonnet-linux-amd648485          # Windows86          - target: i686-pc-windows-msvc87            os: windows-latest88            bin: jrsonnet.exe89            name: jrsonnet-windows-i686.exe90          - target: x86_64-pc-windows-msvc91            os: windows-latest92            bin: jrsonnet.exe93            name: jrsonnet-windows-amd64.exe9495          # Apple96          - target: aarch64-apple-darwin97            os: macOS-latest98            bin: jrsonnet99            name: jrsonnet-darwin-aarch64100          - target: x86_64-apple-darwin101            os: macOS-latest102            bin: jrsonnet103            name: jrsonnet-darwin-amd64104    runs-on: ${{ matrix.os }}105    steps:106      - name: Fetch apt repo updates107        if: ${{ startsWith(matrix.os, 'ubuntu-') }}108        run: sudo apt update109110      - name: Install stable toolchain111        uses: actions-rs/toolchain@v1112        with:113          toolchain: stable114          override: true115          target: ${{ matrix.target }}116117      - name: Checkout118        uses: actions/checkout@v2119120      - name: Add experimental flags121        if: ${{ endsWith(github.ref, '-test' )}}122        run: echo 'EXPERIMENTAL_FLAGS=--features=experimental' >> $GITHUB_ENV123124      - name: Linux x86 cross compiler125        if: ${{ startsWith(matrix.target, 'i686-unknown-linux-') }}126        run: sudo apt install gcc-multilib127128      - name: ARM cross compiler129        if: ${{ startsWith(matrix.target, 'aarch64-unknown-linux-') }}130        uses: actions-rs/cargo@v1131        with:132          command: install133          args: cross134135      - name: ARM gcc136        if: ${{ startsWith(matrix.target, 'aarch64-unknown-linux-') }}137        run: sudo apt install gcc-aarch64-linux-gnu138139      - name: Musl gcc140        if: ${{ endsWith(matrix.target, '-musl') }}141        run: sudo apt install musl musl-tools142143      - name: Run cross build144        if: ${{ startsWith(matrix.target, 'aarch64-unknown-linux-') }}145        shell: bash146        run: cross build --bin=jrsonnet --release --target ${{ matrix.target }} ${{ env.EXPERIMENTAL_FLAGS }}147148      - name: Run build149        if: ${{ !startsWith(matrix.target, 'aarch64-unknown-linux-') }}150        uses: actions-rs/cargo@v1151        with:152          command: build153          args: --bin=jrsonnet --release --target ${{ matrix.target }} ${{ env.EXPERIMENTAL_FLAGS }}154155      - name: Package156        shell: bash157        run: |158          cd target/${{ matrix.target }}/release159160          cp ${{ matrix.bin }} ../../../${{ matrix.name }}161          cd -162163      - name: Generate SHA-256164        run: shasum -a 256 ${{ matrix.name }} > ${{ matrix.name }}.sha256165166      - name: Publish167        uses: softprops/action-gh-release@v1168        with:169          draft: true170          files: "jrsonnet*"171        env:172          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}