@@ -18,50 +18,54 @@ jobs:
18
18
runs-on : ${{ matrix.runs-on }}
19
19
strategy :
20
20
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]
22
22
runs-on : [ubuntu-latest]
23
23
cross : [true]
24
24
include :
25
- - os : x86_64-apple-darwin
25
+ - target : x86_64-apple-darwin
26
26
runs-on : macos-latest # Apple needs to be compiled on an apple os
27
27
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?
30
30
suffix : .exe # Windows has an .exe suffix
31
31
cross : false # Cross fails on these platforms
32
32
33
33
steps :
34
34
- uses : actions/checkout@v2
35
35
36
36
- name : Install Rust
37
- uses : actions-rs/ toolchain@v1
37
+ uses : dtolnay/rust- toolchain@stable
38
38
with :
39
39
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
43
51
44
52
- 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 }}
50
54
51
55
- name : Save Artifact
52
56
uses : actions/upload-artifact@v4
53
57
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 }}
56
60
57
61
- name : Upload Binary
58
62
if : github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v')
59
63
uses : actions/upload-release-asset@v1
60
64
env :
61
65
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
62
66
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 }}
65
69
upload_url : ${{ github.event.release.upload_url }}
66
70
asset_content_type : application/octet-stream
67
71
70
74
with :
71
75
use-cross : ${{ matrix.cross }}
72
76
command : test
73
- args : --target ${{ matrix.os }} --verbose
77
+ args : --target ${{ matrix.target }} --verbose
74
78
75
79
clippy_check :
76
80
runs-on : ubuntu-latest
0 commit comments