|
1 | 1 | name: "Setup Cmux" |
2 | 2 | description: "Setup Bun and install dependencies with caching" |
| 3 | +inputs: |
| 4 | + install-imagemagick: |
| 5 | + description: "Install ImageMagick (needed for electron-builder icon generation)" |
| 6 | + required: false |
| 7 | + default: "false" |
3 | 8 | runs: |
4 | 9 | using: "composite" |
5 | 10 | steps: |
|
8 | 13 | with: |
9 | 14 | bun-version: latest |
10 | 15 |
|
11 | | - - name: Cache bun dependencies |
| 16 | + - name: Get Bun version |
| 17 | + id: bun-version |
| 18 | + shell: bash |
| 19 | + run: echo "version=$(bun --version)" >> $GITHUB_OUTPUT |
| 20 | + |
| 21 | + - name: Cache node_modules |
12 | 22 | uses: actions/cache@v4 |
13 | 23 | with: |
14 | | - path: ~/.bun/install/cache |
15 | | - key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} |
| 24 | + path: node_modules |
| 25 | + key: ${{ runner.os }}-${{ runner.arch }}-bun-${{ steps.bun-version.outputs.version }}-node-modules-${{ hashFiles('**/bun.lock') }} |
16 | 26 | restore-keys: | |
17 | | - ${{ runner.os }}-bun- |
| 27 | + ${{ runner.os }}-${{ runner.arch }}-bun-${{ steps.bun-version.outputs.version }}-node-modules- |
18 | 28 |
|
19 | | - - name: Cache Homebrew (macOS) |
20 | | - if: runner.os == 'macOS' |
| 29 | + - name: Cache bun install cache |
21 | 30 | uses: actions/cache@v4 |
22 | 31 | with: |
23 | | - path: ~/Library/Caches/Homebrew |
24 | | - key: ${{ runner.os }}-brew-cache-${{ hashFiles('**/bun.lock') }} |
| 32 | + path: ~/.bun/install/cache |
| 33 | + key: ${{ runner.os }}-bun-cache-${{ hashFiles('**/bun.lock') }} |
25 | 34 | restore-keys: | |
26 | | - ${{ runner.os }}-brew-cache- |
| 35 | + ${{ runner.os }}-bun-cache- |
27 | 36 |
|
28 | 37 | - name: Install dependencies |
29 | 38 | shell: bash |
30 | 39 | run: bun install --frozen-lockfile |
31 | 40 |
|
32 | 41 | - name: Install ImageMagick (macOS) |
33 | | - if: runner.os == 'macOS' |
| 42 | + if: inputs.install-imagemagick == 'true' && runner.os == 'macOS' |
34 | 43 | shell: bash |
35 | 44 | run: | |
36 | | - if ! brew list imagemagick &>/dev/null; then |
37 | | - echo "📦 Installing ImageMagick..." |
38 | | - time brew install imagemagick |
| 45 | + if command -v magick &>/dev/null; then |
| 46 | + echo "✅ ImageMagick already available" |
39 | 47 | else |
40 | | - echo "✅ ImageMagick already installed" |
41 | | - brew list imagemagick --versions |
| 48 | + echo "📦 Installing ImageMagick..." |
| 49 | + HOMEBREW_NO_AUTO_UPDATE=1 brew install imagemagick |
42 | 50 | fi |
43 | | - # Verify it's in PATH |
44 | | - which magick |
45 | 51 | magick --version | head -1 |
46 | 52 |
|
47 | 53 | - name: Install ImageMagick (Linux) |
48 | | - if: runner.os == 'Linux' |
| 54 | + if: inputs.install-imagemagick == 'true' && runner.os == 'Linux' |
49 | 55 | shell: bash |
50 | 56 | run: | |
51 | | - if ! command -v convert &> /dev/null; then |
52 | | - echo "Installing ImageMagick..." |
53 | | - sudo apt-get update -qq |
54 | | - sudo apt-get install -y imagemagick |
| 57 | + if command -v convert &>/dev/null; then |
| 58 | + echo "✅ ImageMagick already available" |
55 | 59 | else |
56 | | - echo "ImageMagick already installed" |
| 60 | + echo "📦 Installing ImageMagick..." |
| 61 | + sudo apt-get update -qq |
| 62 | + sudo apt-get install -y --no-install-recommends imagemagick |
57 | 63 | fi |
| 64 | + convert --version | head -1 |
0 commit comments