10
10
11
11
jobs :
12
12
build-and-release :
13
- runs-on : ubuntu-latest
13
+ strategy :
14
+ matrix :
15
+ include :
16
+ - os : ubuntu-latest
17
+ target : x86_64-unknown-linux-gnu
18
+ binary_name : bedder-static-linux-x86_64
19
+ use_staticx : true
20
+ - os : macos-latest
21
+ target : x86_64-apple-darwin
22
+ binary_name : bedder-static-macos-x86_64
23
+ use_staticx : false
24
+
25
+ runs-on : ${{ matrix.os }}
14
26
permissions :
15
27
contents : write # Required for creating releases
16
28
22
34
uses : dtolnay/rust-toolchain@stable
23
35
with :
24
36
toolchain : stable
37
+ targets : ${{ matrix.target }}
25
38
26
39
- name : Cache cargo registry
27
40
uses : actions/cache@v4
35
48
restore-keys : |
36
49
${{ runner.os }}-cargo-
37
50
38
- - name : Install system dependencies
51
+ - name : Install Linux system dependencies
52
+ if : matrix.os == 'ubuntu-latest'
39
53
run : |
40
54
sudo apt-get update
41
55
sudo apt-get install -y \
@@ -46,26 +60,62 @@ jobs:
46
60
zlib1g-dev \
47
61
pkg-config
48
62
49
- - name : Install staticx
63
+ - name : Install staticx (Linux only)
64
+ if : matrix.use_staticx
50
65
run : |
51
66
python3 -m pip install --user staticx
52
67
echo "$HOME/.local/bin" >> $GITHUB_PATH
53
68
54
69
- name : Build release binary
55
- run : cargo build --release
70
+ run : cargo build --release --target ${{ matrix.target }}
56
71
57
- - name : Create static binary with staticx
72
+ - name : Create static binary with staticx (Linux)
73
+ if : matrix.use_staticx
58
74
run : |
59
- staticx ./target/release/bedder ./bedder-static-linux-x86_64
60
- chmod +x ./bedder-static-linux-x86_64
75
+ staticx ./target/${{ matrix.target }}/release/bedder ./${{ matrix.binary_name }}
76
+ chmod +x ./${{ matrix.binary_name }}
77
+
78
+ - name : Create mostly static binary (macOS)
79
+ if : matrix.os == 'macos-latest'
80
+ run : |
81
+ # Copy the binary and rename it
82
+ cp ./target/${{ matrix.target }}/release/bedder ./${{ matrix.binary_name }}
83
+ chmod +x ./${{ matrix.binary_name }}
84
+
85
+ # Show dependencies for verification
86
+ echo "Dependencies for macOS binary:"
87
+ otool -L ./${{ matrix.binary_name }} || true
61
88
62
- - name : Test static binary
89
+ - name : Test binary
63
90
run : |
64
- ./bedder-static-linux-x86_64 --help || echo "Binary test failed"
65
- ldd ./bedder-static-linux-x86_64 || echo "Static binary verified (no dynamic dependencies)"
66
- ls -lh ./bedder-static-linux-x86_64
91
+ ./${{ matrix.binary_name }} --help || echo "Binary test failed"
92
+ ls -lh ./${{ matrix.binary_name }}
67
93
68
- - name : Create Release and Upload Asset
94
+ # Platform-specific dependency checks
95
+ if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
96
+ ldd ./${{ matrix.binary_name }} || echo "Static binary verified (no dynamic dependencies)"
97
+ elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then
98
+ echo "macOS binary dependencies:"
99
+ otool -L ./${{ matrix.binary_name }} || true
100
+ fi
101
+
102
+ - name : Upload binary artifact
103
+ uses : actions/upload-artifact@v4
104
+ with :
105
+ name : ${{ matrix.binary_name }}
106
+ path : ${{ matrix.binary_name }}
107
+
108
+ release :
109
+ needs : build-and-release
110
+ runs-on : ubuntu-latest
111
+ permissions :
112
+ contents : write
113
+
114
+ steps :
115
+ - name : Download all artifacts
116
+ uses : actions/download-artifact@v4
117
+
118
+ - name : Create Release and Upload Assets
69
119
uses : softprops/action-gh-release@v2
70
120
with :
71
121
name : Release ${{ github.ref_name }}
@@ -74,8 +124,11 @@ jobs:
74
124
75
125
### Downloads
76
126
- **bedder-static-linux-x86_64**: Static binary for Linux x86_64 (no dependencies required)
127
+ - **bedder-static-macos-x86_64**: Mostly static binary for macOS x86_64 (minimal system dependencies)
77
128
78
129
### Installation
130
+
131
+ #### Linux
79
132
```bash
80
133
# Download and make executable
81
134
wget https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/bedder-static-linux-x86_64
@@ -85,12 +138,23 @@ jobs:
85
138
sudo mv bedder-static-linux-x86_64 /usr/local/bin/bedder
86
139
```
87
140
141
+ #### macOS
142
+ ```bash
143
+ # Download and make executable
144
+ wget https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/bedder-static-macos-x86_64
145
+ chmod +x bedder-static-macos-x86_64
146
+
147
+ # Optional: Move to PATH
148
+ sudo mv bedder-static-macos-x86_64 /usr/local/bin/bedder
149
+ ```
150
+
88
151
### Binary Info
89
- - **Size **: ~6MB
90
- - **Dependencies **: None (fully static )
152
+ - **Linux binary **: Fully static ( ~6MB, no dependencies)
153
+ - **macOS binary **: Mostly static (~6MB, minimal system dependencies )
91
154
- **Python**: Works with any Python 3.8+ system
92
- - **Architecture**: x86_64 Linux
155
+ - **Architecture**: x86_64
93
156
files : |
94
- bedder-static-linux-x86_64
157
+ bedder-static-linux-x86_64/bedder-static-linux-x86_64
158
+ bedder-static-macos-x86_64/bedder-static-macos-x86_64
95
159
draft : false
96
160
prerelease : false
0 commit comments