11
11
runs-on : ${{ matrix.os }}
12
12
strategy :
13
13
matrix :
14
- os : [ubuntu-latest, macos-latest, windows-latest]
14
+ os : [macos-latest, windows-latest]
15
15
target :
16
16
- x86_64-unknown-linux-gnu
17
17
- x86_64-apple-darwin
@@ -21,24 +21,23 @@ jobs:
21
21
- name : Checkout repository
22
22
uses : actions/checkout@v3
23
23
24
+ - name : Cache cargo registry
25
+ uses : actions/cache@v3
26
+ with :
27
+ path : ~/.cargo/registry
28
+ key : ${{ runner.os }}-cargo-registry
29
+ restore-keys : |
30
+ ${{ runner.os }}-cargo-registry
31
+
24
32
- name : Set up Rust
25
33
uses : actions-rs/toolchain@v1
26
34
with :
27
35
toolchain : stable
28
36
target : ${{ matrix.target }}
29
37
override : true
30
38
31
- - name : Install cross (for Linux builds)
32
- if : matrix.os == 'ubuntu-latest'
33
- run : cargo install cross
34
-
35
- - name : Build with cargo (or cross for Linux)
36
- run : |
37
- if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
38
- cross build --release --target ${{ matrix.target }}
39
- else
40
- cargo build --release --target ${{ matrix.target }}
41
- fi
39
+ - name : Build with cargo
40
+ run : cargo build --release --target ${{ matrix.target }}
42
41
43
42
- name : Upload binary artifact
44
43
uses : actions/upload-artifact@v3
@@ -71,21 +70,21 @@ jobs:
71
70
with :
72
71
upload_url : ${{ steps.create_release.outputs.upload_url }}
73
72
asset_path : target/x86_64-unknown-linux-gnu/release/gcs
74
- asset_name : your-cli-linux
73
+ asset_name : gcs
75
74
asset_content_type : application/octet-stream
76
75
77
76
- name : Upload Release Asset (macOS)
78
77
uses : actions/upload-release-asset@v1
79
78
with :
80
79
upload_url : ${{ steps.create_release.outputs.upload_url }}
81
80
asset_path : target/x86_64-apple-darwin/release/gcs
82
- asset_name : your-cli-macos
81
+ asset_name : gcs
83
82
asset_content_type : application/octet-stream
84
83
85
84
- name : Upload Release Asset (Windows)
86
85
uses : actions/upload-release-asset@v1
87
86
with :
88
87
upload_url : ${{ steps.create_release.outputs.upload_url }}
89
88
asset_path : target/x86_64-pc-windows-gnu/release/gcs.exe
90
- asset_name : your-cli-windows .exe
89
+ asset_name : gcs .exe
91
90
asset_content_type : application/octet-stream
0 commit comments