@@ -18,50 +18,54 @@ jobs:
1818 runs-on : ${{ matrix.runs-on }}
1919 strategy :
2020 matrix :
21- os : [x86_64-unknown-linux-musl, x86_64-unknown-linux-gnu]
21+ target : [x86_64-unknown-linux-musl, x86_64-unknown-linux-gnu]
2222 runs-on : [ubuntu-latest]
2323 cross : [true]
2424 include :
25- - os : x86_64-apple-darwin
25+ - target : x86_64-apple-darwin
2626 runs-on : macos-latest # Apple needs to be compiled on an apple os
2727 cross : false # Cross fails on these platforms
28- - os : x86_64-pc-windows-gnu
29- runs-on : windows -latest # Not needed, but why not?
28+ - target : x86_64-pc-windows-gnu
29+ runs-on : ubuntu -latest # Not needed, but why not?
3030 suffix : .exe # Windows has an .exe suffix
3131 cross : false # Cross fails on these platforms
3232
3333 steps :
3434 - uses : actions/checkout@v2
3535
3636 - name : Install Rust
37- uses : actions-rs/ toolchain@v1
37+ uses : dtolnay/rust- toolchain@stable
3838 with :
3939 toolchain : stable
40- override : true
41- profile : minimal
42- target : ${{ matrix.os }}
40+ components : rustfmt
41+ target : ${{ matrix.target }}
42+
43+ - name : Install mingw compiler
44+ if : matrix.target == 'x86_64-pc-windows-gnu'
45+ run : |
46+ sudo apt-get update
47+ sudo apt-get install -y gcc-mingw-w64
48+
49+ - name : Install Cross
50+ run : cargo install cross
4351
4452 - name : Build Binary
45- uses : actions-rs/cargo@v1
46- with :
47- use-cross : ${{ matrix.cross }}
48- command : build
49- args : --target ${{ matrix.os }} --release
53+ run : cross build --profile release --target ${{ matrix.target }}
5054
5155 - name : Save Artifact
5256 uses : actions/upload-artifact@v4
5357 with :
54- name : dbimport-${{ matrix.os }}${{ matrix.suffix }}
55- path : target/${{ matrix.os }}/release/dbimport${{ matrix.suffix }}
58+ name : dbimport-${{ matrix.target }}${{ matrix.suffix }}
59+ path : target/${{ matrix.target }}/release/dbimport${{ matrix.suffix }}
5660
5761 - name : Upload Binary
5862 if : github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v')
5963 uses : actions/upload-release-asset@v1
6064 env :
6165 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6266 with :
63- asset_name : dbimport-${{ matrix.os }}${{ matrix.suffix }}
64- asset_path : target/${{ matrix.os }}/release/dbimport${{ matrix.suffix }}
67+ asset_name : dbimport-${{ matrix.target }}${{ matrix.suffix }}
68+ asset_path : target/${{ matrix.target }}/release/dbimport${{ matrix.suffix }}
6569 upload_url : ${{ github.event.release.upload_url }}
6670 asset_content_type : application/octet-stream
6771
7074 with :
7175 use-cross : ${{ matrix.cross }}
7276 command : test
73- args : --target ${{ matrix.os }} --verbose
77+ args : --target ${{ matrix.target }} --verbose
7478
7579 clippy_check :
7680 runs-on : ubuntu-latest
0 commit comments