Repository navigation
116 lines (98 loc) · 2.98 KB
/
Copy pathbuild.yml
File metadata and controls
116 lines (98 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Build and Package
on:
release:
types: [created]
env:
CARGO_TERM_COLOR: always
permissions:
contents: write
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
package: deb
- os: macos-latest
target: x86_64-apple-darwin
package: dmg
- os: macos-latest
target: aarch64-apple-darwin
package: dmg
- os: windows-latest
target: x86_64-pc-windows-msvc
package: msi
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
pkg-config \
libfontconfig1-dev \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxkbcommon-dev \
libgtk-3-dev\
libasound2-dev
- name: Install macOS dependencies
if: matrix.os == 'macos-latest'
run: |
brew update || true
brew install pkg-config fontconfig || true
- name: Verify pkg-config fontconfig (debug)
if: matrix.os == 'ubuntu-latest'
run: |
echo "Verifying fontconfig via pkg-config"
pkg-config --modversion fontconfig
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Package (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install -y dpkg
cargo install cargo-deb
cargo deb --target ${{ matrix.target }}
- name: Upload Release Asset (Linux)
if: matrix.os == 'ubuntu-latest'
uses: softprops/action-gh-release@v2
with:
files: target/${{ matrix.target }}/debian/*.deb
- name: Package (macOS)
if: matrix.os == 'macos-latest'
run: |
cargo install cargo-bundle
cargo bundle --release --target ${{ matrix.target }}
- name: Upload Release Asset (macOS)
if: matrix.os == 'macos-latest'
uses: softprops/action-gh-release@v2
with:
files: target/${{ matrix.target }}/release/bundle/osx/*.dmg
- name: Package (Windows)
if: matrix.os == 'windows-latest'
run: |
cargo install cargo-wix
winget install --id WiXToolset.WiXToolset -e
cargo wix --no-build
- name: Upload Release Asset (Windows)
if: matrix.os == 'windows-latest'
uses: softprops/action-gh-release@v2
with:
files: target/${{ matrix.target }}/release/bundle/msi/*.msi