55 branches : [ "master" ]
66 pull_request :
77 branches : [ "master" ]
8+ workflow_dispatch :
9+
10+ permissions :
11+ contents : write
812
913env :
1014 CARGO_TERM_COLOR : always
@@ -14,90 +18,75 @@ jobs:
1418 check :
1519 runs-on : ubuntu-latest
1620 steps :
17- - uses : actions/checkout@v4
18-
19- - uses : dtolnay/rust-toolchain@stable
20- with :
21- components : rustfmt, clippy
22-
23- - uses : Swatinem/rust-cache@v2
24-
25- - name : Check formatting
26- run : cargo fmt --all -- --check
27-
28- - name : Clippy
29- run : cargo clippy --all-targets --all-features
21+ - uses : actions/checkout@v4
22+ - uses : dtolnay/rust-toolchain@stable
23+ with :
24+ components : rustfmt, clippy
25+ - uses : Swatinem/rust-cache@v2
26+ - name : Check formatting
27+ run : cargo fmt --all -- --check
28+ - name : Clippy
29+ run : cargo clippy --all-targets --all-features
3030
3131 test :
3232 runs-on : ${{ matrix.os }}
3333 strategy :
3434 matrix :
35- os : [ubuntu-latest, windows-latest, macos-latest ]
35+ os : [ ubuntu-latest, windows-latest ]
3636 steps :
37- - uses : actions/checkout@v4
38-
39- - uses : dtolnay/rust-toolchain@stable
40-
41- - uses : Swatinem/rust-cache@v2
42-
43- - name : Run tests
44- run : cargo test --release
37+ - uses : actions/checkout@v4
38+ - uses : dtolnay/rust-toolchain@stable
39+ - uses : Swatinem/rust-cache@v2
40+ - name : Run tests
41+ run : cargo test --release
4542
4643 build :
47- needs : [check, test]
44+ needs : [ check, test ]
4845 runs-on : ${{ matrix.os }}
4946 strategy :
5047 matrix :
5148 include :
49+ # --- Linux 64-bit ---
5250 - os : ubuntu-latest
5351 target : x86_64-unknown-linux-gnu
5452 artifact_name : rust_rest_api
5553 asset_name : rust_rest_api-linux-x86_64
54+ # --- Windows 64-bit ---
5655 - os : windows-latest
5756 target : x86_64-pc-windows-msvc
5857 artifact_name : rust_rest_api.exe
5958 asset_name : rust_rest_api-windows-x86_64.exe
60- - os : macos-latest
61- target : x86_64-apple-darwin
62- artifact_name : rust_rest_api
63- asset_name : rust_rest_api-macos-x86_64
64- - os : macos-latest
65- target : aarch64-apple-darwin
66- artifact_name : rust_rest_api
67- asset_name : rust_rest_api-macos-aarch64
6859 steps :
69- - uses : actions/checkout@v4
70-
71- - uses : dtolnay/rust-toolchain@stable
72- with :
73- targets : ${{ matrix.target }}
74-
75- - uses : Swatinem/rust-cache@v2
76-
77- - name : Build release binary
78- run : cargo build --release --target ${{ matrix.target }}
79-
80- - name : Upload artifact
81- uses : actions/upload-artifact@v4
82- with :
83- name : ${{ matrix.asset_name }}
84- path : target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
60+ - uses : actions/checkout@v4
61+ - uses : dtolnay/rust-toolchain@stable
62+ with :
63+ targets : ${{ matrix.target }}
64+ - uses : Swatinem/rust-cache@v2
65+ - name : Build release binary
66+ run : cargo build --release --target ${{ matrix.target }}
67+ - name : Upload artifact
68+ uses : actions/upload-artifact@v4
69+ with :
70+ name : ${{ matrix.asset_name }}
71+ path : target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
8572
8673 release :
87- if : startsWith( github.ref, 'refs/tags/')
74+ if : github.ref == 'refs/heads/master'
8875 needs : build
8976 runs-on : ubuntu-latest
9077 steps :
91- - uses : actions/checkout@v4
92-
93- - name : Download all artifacts
94- uses : actions/download-artifact@v4
95- with :
96- path : artifacts
97-
98- - name : Create release
99- uses : softprops/action-gh-release@v1
100- with :
101- files : artifacts/**/*
102- env :
103- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
78+ - name : Download all artifacts
79+ uses : actions/download-artifact@v4
80+ with :
81+ path : artifacts
82+ merge-multiple : false
83+ - name : Create draft release (nightly)
84+ uses : softprops/action-gh-release@v1
85+ with :
86+ draft : true
87+ tag_name : nightly-${{ github.run_number }}
88+ name : Nightly ${{ github.run_number }}
89+ generate_release_notes : true
90+ files : artifacts/**/*
91+ env :
92+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments