6969 - target : aarch64-apple-darwin
7070 arch : arm64
7171 os : macos
72- runs-on : ${{ matrix.os == 'windows' && 'windows-latest' || matrix.os == 'macos' && 'macos-latest' || 'ubuntu-latest' }}
72+ - target : x86_64-unknown-freebsd
73+ arch : x64
74+ os : freebsd
75+ - target : aarch64-unknown-freebsd
76+ arch : arm64
77+ os : freebsd
78+ runs-on : ${{ matrix.os == 'freebsd' && 'ubuntu-latest' || matrix.os == 'windows' && 'windows-latest' || matrix.os == 'macos' && 'macos-latest' || 'ubuntu-latest' }}
7379
7480 steps :
7581 - uses : actions/checkout@v4
8288
8389
8490 - name : Cache cargo registry
91+ if : matrix.os != 'freebsd'
8592 uses : actions/cache@v4
8693 with :
8794 path : |
@@ -93,9 +100,22 @@ jobs:
93100 ${{ runner.os }}-${{ matrix.target }}-cargo-
94101
95102 - name : Build release binary
103+ if : matrix.os != 'freebsd'
96104 run : |
97105 cargo build --release --target ${{ matrix.target }}
98106
107+ - name : Build release binary (FreeBSD)
108+ if : matrix.os == 'freebsd'
109+ uses : vmactions/freebsd-vm@v1
110+ with :
111+ release : ' 15.0'
112+ usesh : true
113+ prepare : |
114+ pkg update -f
115+ pkg install -y rust
116+ run : |
117+ cargo build --release --target ${{ matrix.target }}
118+
99119 - name : Create release archive (Unix)
100120 if : matrix.os != 'windows'
101121 run : |
@@ -104,6 +124,20 @@ jobs:
104124 strip release/obs-cmd${{ matrix.os == 'windows' && '.exe' || '' }} || true
105125 tar -czf obs-cmd-${{ matrix.arch }}-${{ matrix.os }}.tar.gz -C release obs-cmd${{ matrix.os == 'windows' && '.exe' || '' }}
106126
127+ - name : Create release archive (FreeBSD)
128+ if : matrix.os == 'freebsd'
129+ uses : vmactions/freebsd-vm@v1
130+ with :
131+ release : ' 15.0'
132+ usesh : true
133+ prepare : |
134+ pkg install -y rust
135+ run : |
136+ mkdir -p release
137+ cp target/${{ matrix.target }}/release/obs-cmd release/
138+ strip release/obs-cmd || true
139+ tar -czf obs-cmd-${{ matrix.arch }}-${{ matrix.os }}.tar.gz -C release obs-cmd
140+
107141 - name : Create release archive (Windows)
108142 if : matrix.os == 'windows'
109143 run : |
0 commit comments