|
52 | 52 | needs: ['create-release']
|
53 | 53 | runs-on: ${{ matrix.os }}
|
54 | 54 | env:
|
55 |
| - # For some builds, we use cross to test on 32-bit and big-endian |
56 |
| - # systems. |
57 |
| - CARGO: cargo |
58 |
| - # When CARGO is set to CROSS, this is set to `--target matrix.target`. |
59 |
| - TARGET_FLAGS: "" |
60 |
| - # When CARGO is set to CROSS, TARGET_DIR includes matrix.target. |
61 |
| - TARGET_DIR: ./target |
62 | 55 | # Emit backtraces on panics.
|
63 | 56 | RUST_BACKTRACE: 1
|
64 | 57 | # Build static releases with PCRE2.
|
@@ -105,50 +98,40 @@ jobs:
|
105 | 98 | if: matrix.os == 'macos-latest'
|
106 | 99 | run: brew install asciidoctor
|
107 | 100 | - name: Install Rust
|
108 |
| - uses: actions-rs/toolchain@v1 |
| 101 | + uses: dtolnay/rust-toolchain@v1 |
109 | 102 | with:
|
110 | 103 | toolchain: ${{ matrix.rust }}
|
111 |
| - profile: minimal |
112 |
| - override: true |
113 | 104 | target: ${{ matrix.target }}
|
114 | 105 |
|
115 |
| - - name: Use Cross |
116 |
| - shell: bash |
117 |
| - run: | |
118 |
| - cargo install cross cargo-deb |
119 |
| - echo "CARGO=cross" >> $GITHUB_ENV |
120 |
| - echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV |
121 |
| - echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV |
| 106 | + - name: Build release binary (Deb) |
| 107 | + if: matrix.target == 'x86_64-unknown-linux-gnu' |
| 108 | + run: cargo install cargo-deb && cargo deb -p refinery_cli |
122 | 109 |
|
123 | 110 | - name: Build release binary
|
124 |
| - run: | |
125 |
| - if [ "${{matrix.target}}" = "x86_64-unknown-linux-gnu" ]; then |
126 |
| - cargo deb -p refinery_cli |
127 |
| - else |
128 |
| - ${{ env.CARGO }} build -p refinery_cli --release --all-features ${{ env.TARGET_FLAGS }} |
129 |
| - fi |
| 111 | + if: matrix.target != 'x86_64-unknown-linux-gnu' |
| 112 | + run: cargo build -p refinery_cli --release --all-features |
130 | 113 |
|
131 | 114 | - name: Strip release binary (linux and macos)
|
132 | 115 | if: matrix.build == 'linux' || matrix.build == 'macos'
|
133 |
| - run: strip "target/${{ matrix.target }}/release/refinery" |
| 116 | + run: strip "target/release/refinery" |
134 | 117 |
|
135 | 118 | - name: Build archive
|
136 | 119 | shell: bash
|
137 | 120 | run: |
|
138 |
| - if [ "${{matrix.target}}" = "x86_64-unknown-linux-gnu" ]; then |
| 121 | + if [[ "${{matrix.target}}" = "x86_64-unknown-linux-gnu" ]]; then |
139 | 122 | mv target/debian/refinery_${{ needs.create-release.outputs.refinery_version }}_amd64.deb .
|
140 | 123 | echo "ASSET=refinery_${{ needs.create-release.outputs.refinery_version }}_amd64.deb" >> $GITHUB_ENV
|
141 | 124 | else
|
142 | 125 | staging="refinery-${{ needs.create-release.outputs.refinery_version }}-${{ matrix.target }}"
|
143 | 126 | mkdir -p "$staging"/doc
|
144 | 127 | cp {README.md,LICENSE} "$staging/"
|
145 | 128 | cp CHANGELOG.md "$staging/doc/"
|
146 |
| - if [ "${{ matrix.os }}" = "windows-2019" ]; then |
147 |
| - cp "target/${{ matrix.target }}/release/refinery.exe" "$staging/" |
| 129 | + if [[ "${{ matrix.os }}" = "windows-2019" ]]; then |
| 130 | + cp "target/release/refinery.exe" "$staging/" |
148 | 131 | 7z a "$staging.zip" "$staging"
|
149 | 132 | echo "ASSET=$staging.zip" >> $GITHUB_ENV
|
150 | 133 | else
|
151 |
| - cp "target/${{ matrix.target }}/release/refinery" "$staging/" |
| 134 | + cp "target/release/refinery" "$staging/" |
152 | 135 | tar czf "$staging.tar.gz" "$staging"
|
153 | 136 | echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
|
154 | 137 | fi
|
|
0 commit comments