Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Commit 2052ffb

Browse files
committed
Build a release asset for FreeBSD
This uses the `vmactions/freebsd-vm` GitHub Action to build an asset for FreeBSD alongside the existing assets. See issue 438 for context. The build steps as written produce a working binary on FreeBSD 14.0 x86_64. Note however that the VM used for CI is FreeBSD 13.2; this is because binaries built on a FreeBSD system are forward- but not backward-compatible with other FreeBSD versions. That is, an executable built on 14.0 wouldn't necessarily work on 13.2, but one built on 13.2 will work on 14.0. The choice of 13.2 in particular is because it's the oldest currently supported release. Python 3.11 is used for consistency with other platforms. Unlike other platforms, this build utilizes a virtual environment, simply because it's easier and less error prone.
1 parent c1ed47c commit 2052ffb

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/build_assets.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,44 @@ jobs:
130130
asset_name: codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }}
131131
tag: ${{ github.ref }}
132132
overwrite: true
133+
134+
build_assets_freebsd:
135+
name: Build assets - FreeBSD
136+
runs-on: ubuntu-latest
137+
steps:
138+
- uses: actions/checkout@v4
139+
with:
140+
submodules: true
141+
- name: Run in VM
142+
uses: vmactions/freebsd-vm@v1
143+
with:
144+
release: "13.5"
145+
usesh: true
146+
prepare: |
147+
pkg update
148+
pkg install -y python311
149+
run: |
150+
python3.11 -m venv .venv --upgrade-deps
151+
. .venv/bin/activate
152+
pip install -r requirements.txt
153+
pip install .
154+
python setup.py build
155+
pip install pyinstaller
156+
pyinstaller --copy-metadata codecov-cli -F codecov_cli/main.py
157+
cp ./dist/main ./dist/codecovcli_freebsd
158+
- name: Upload a Build Artifact
159+
uses: actions/upload-artifact@v4
160+
if: inputs.release == false
161+
with:
162+
name: codecovcli_freebsd
163+
path: ./dist/codecovcli_freebsd
164+
- name: Upload Release Asset
165+
if: inputs.release == true
166+
id: upload-release-asset
167+
uses: svenstaro/upload-release-action@v2
168+
with:
169+
repo_token: ${{ secrets.GITHUB_TOKEN }}
170+
file: ./dist/codecovcli_freebsd
171+
asset_name: codecovcli_freebsd
172+
tag: ${{ github.ref }}
173+
overwrite: true

0 commit comments

Comments
 (0)