@@ -69,21 +69,48 @@ jobs:
6969 - uses : actions/checkout@v4
7070
7171 - name : Setup
72- if : ${{ matrix.setup != null }}
72+ if : matrix.setup != null
7373 run : ${{ matrix.setup }}
7474
7575 - name : Setup rust
7676 run : rustup target add ${{ matrix.target }}
7777
78- - name : Test (debug) (test=${{ matrix.test }})
79- if : ${{ matrix.test == null || matrix.test }}
78+ - name : Test (debug)
79+ if : matrix.test == null || matrix.test == true
8080 run : cargo test --target ${{ matrix.target }} --workspace --exclude portablemc-py -- --include-ignored
8181
8282 - name : Build (release)
8383 run : cargo build --target ${{ matrix.target }} --release --workspace --exclude portablemc-py
8484
8585 - name : Debug path
86- run : ls -la ./target/${{ matrix.target }}/release
86+ run : ls ./target/${{ matrix.target }}/release
87+
88+ - name : Collect artifacts (linux)
89+ if : contains(matrix.target, 'linux')
90+ run : >
91+ mkdir ~/portablemc &&
92+ cp -r ./portablemc-ffi/include/ ~/portablemc/ &&
93+ cp ./target/${{ matrix.target }}/portablemc ./target/${{ matrix.target }}/libportablemc.{a,so} ~/portablemc/
94+
95+ - name : Collect artifacts (apple)
96+ if : contains(matrix.target, 'apple')
97+ run : >
98+ mkdir ~/portablemc &&
99+ cp -r ./portablemc-ffi/include/ ~/portablemc/ &&
100+ cp ./target/${{ matrix.target }}/portablemc ./target/${{ matrix.target }}/libportablemc.{a,dylib} ~/portablemc/
101+
102+ - name : Collect artifacts (windows)
103+ if : contains(matrix.target, 'windows')
104+ run : >
105+ (mkdir ~/portablemc) -and
106+ (cp ./portablemc-ffi/include/ ~/portablemc/) -and
107+ ("exe","lib","dll" | % { cp "./target/${{ matrix.target }}/portablemc.$_" ~/portablemc/ })
108+
109+ - name : Upload artifacts
110+ uses : actions/upload-artifact@v4
111+ with :
112+ name : artifact-${{ matrix.target }}
113+ path : ~/portablemc/
87114
88115 publish :
89116 needs : build
0 commit comments