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

Commit d2911a5

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 8364881 commit d2911a5

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
@@ -132,3 +132,44 @@ jobs:
132132
asset_name: codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }}
133133
tag: ${{ github.ref }}
134134
overwrite: true
135+
136+
build_assets_freebsd:
137+
name: Build assets - FreeBSD
138+
runs-on: ubuntu-latest
139+
steps:
140+
- uses: actions/checkout@v4
141+
with:
142+
submodules: true
143+
- name: Run in VM
144+
uses: vmactions/freebsd-vm@v1
145+
with:
146+
release: "13.2"
147+
usesh: true
148+
prepare: |
149+
pkg update
150+
pkg install -y python311 rust
151+
run: |
152+
python3.11 -m venv .venv --upgrade-deps
153+
. .venv/bin/activate
154+
pip install -r requirements.txt
155+
pip install .
156+
python setup.py build
157+
STATICCODECOV_LIB_PATH=$(find build/ -maxdepth 1 -type d -name 'lib.*' -print -quit | xargs -I {} sh -c "find {} -type f -name 'staticcodecov*' print -quit | sed 's|^./||'")
158+
pip install pyinstaller
159+
pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --copy-metadata codecov-cli --hidden-import staticcodecov_languages -F codecov_cli/main.py
160+
cp ./dist/main ./dist/codecovcli_freebsd
161+
- name: Upload a Build Artifact
162+
uses: actions/upload-artifact@v4
163+
if: inputs.release == false
164+
with:
165+
path: ./dist/codecovcli_freebsd
166+
- name: Upload Release Asset
167+
if: inputs.release == true
168+
id: upload-release-asset
169+
uses: svenstaro/upload-release-action@v2
170+
with:
171+
repo_token: ${{ secrets.GITHUB_TOKEN }}
172+
file: ./dist/codecovcli_freebsd
173+
asset_name: codecovcli_freebsd
174+
tag: ${{ github.ref }}
175+
overwrite: true

0 commit comments

Comments
 (0)