1414 RUST_BACKTRACE : 1
1515
1616jobs :
17- test :
17+ # test:
18+ # strategy:
19+ # matrix:
20+ # # macos-13 is x86, macos-latest is arm64
21+ # os: [ubuntu-22.04, windows-latest, macos-13, macos-latest]
22+ # fail-fast: false
23+ # runs-on: ${{ matrix.os }}
24+ # steps:
25+ # - uses: actions/checkout@v4
26+ # - name: Cache
27+ # uses: actions/cache@v4
28+ # with:
29+ # path: |
30+ # ~/.cargo/registry
31+ # ~/.cargo/git
32+ # target
33+ # key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
34+ # - uses: taiki-e/install-action@cargo-hack
35+ # - name: Clippy
36+ # run: cargo hack clippy --each-feature --no-dev-deps --features std --ignore-unknown-features -- --deny warnings
37+ # - name: Format
38+ # run: cargo fmt --check
39+ # - name: Set up git user
40+ # run: |
41+ # git config --global user.email "user@sysand.org"
42+ # git config --global user.name "Test User"
43+ # - name: Test Core
44+ # run: cargo test --package sysand-core --verbose --features filesystem,js,python,alltests
45+ # - name: Test CLI
46+ # run: cargo test --package sysand --verbose --features alltests
1847
48+ build :
1949 strategy :
2050 matrix :
2151 # macos-13 is x86, macos-latest is arm64
2252 os : [ubuntu-22.04, windows-latest, macos-13, macos-latest]
23- fail-fast : false
24-
2553 runs-on : ${{ matrix.os }}
26-
54+ # needs: [test]
2755 steps :
2856 - uses : actions/checkout@v4
2957 - name : Cache
@@ -34,16 +62,51 @@ jobs:
3462 ~/.cargo/git
3563 target
3664 key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
37- - uses : taiki-e/install-action@cargo-hack
38- - name : Clippy
39- run : cargo hack clippy --each-feature --no-dev-deps --features std --ignore-unknown-features -- --deny warnings
40- - name : Format
41- run : cargo fmt --check
42- - name : Set up git user
43- run : |
44- git config --global user.email "user@sysand.org"
45- git config --global user.name "Test User"
46- - name : Test Core
47- run : cargo test --package sysand-core --verbose --features filesystem,js,python,alltests
48- - name : Test CLI
49- run : cargo test --package sysand --verbose --features alltests
65+ - name : Build
66+ run : cargo build --bin sysand --release
67+ - name : Create the distribution directory
68+ run : mkdir -p dist
69+ - name : Copy binaries
70+ if : matrix.os == 'windows-latest'
71+ run : cp target/release/sysand.exe dist/sysand-${{ matrix.os }}.exe
72+ - name : Copy binaries
73+ if : matrix.os != 'windows-latest'
74+ run : cp target/release/sysand dist/sysand-${{ matrix.os }}
75+ - name : Upload binaries
76+ uses : actions/upload-artifact@v4
77+ with :
78+ name : sysand-cli-${{ matrix.platform.os }}
79+ path : dist/*
80+
81+ release :
82+ name : Release
83+ runs-on : ubuntu-latest
84+ needs : [test, build]
85+ permissions :
86+ # Use to sign the release artifacts
87+ id-token : write
88+ # Used to upload release artifacts
89+ contents : write
90+ # Used to generate artifact attestation
91+ attestations : write
92+ steps :
93+ - uses : actions/download-artifact@v4
94+ - name : Generate artifact attestation
95+ uses : actions/attest-build-provenance@v2
96+ with :
97+ subject-path : ' dist/*'
98+ - name : List files
99+ shell : bash
100+ run : ls -dla dist/*
101+ - name : Create release tag
102+ shell : bash
103+ run : echo "TAG_NAME=$(date +v-%Y-%m-%d-%H%M)" >> $GITHUB_ENV
104+ - name : Create a nightly release
105+ uses : softprops/action-gh-release@v2
106+ with :
107+ prerelease : true
108+ files : |
109+ dist/*
110+ overwrite_files : false
111+ tag_name : ${{ env.TAG_NAME }}
112+ name : Nightly Release ${{ env.TAG_NAME }}
0 commit comments