Skip to content

Commit 6365a87

Browse files
committed
Collect artifacts
1 parent 34f02f9 commit 6365a87

3 files changed

Lines changed: 37 additions & 4 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

portablemc-ffi/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ tempfile.workspace = true
2626
# Named like this to avoid collision with portablemc, it's renamed by deploy workflow.
2727
name = "portablemc_ffi"
2828
crate-type = ["staticlib", "cdylib"]
29+
30+
[profile.release]
31+
strip = "debuginfo"

portablemc/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,6 @@ zip.workspace = true
4747

4848
[dev-dependencies]
4949
tempfile.workspace = true
50+
51+
[profile.release]
52+
strip = "debuginfo"

0 commit comments

Comments
 (0)