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

Commit 7e9a8ca

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 d3f982f commit 7e9a8ca

File tree

1 file changed

+40
-2
lines changed

1 file changed

+40
-2
lines changed

.github/workflows/build_assets.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,5 +130,43 @@ jobs:
130130
tag: ${{ github.ref }}
131131
overwrite: true
132132

133-
134-
133+
build_assets_freebsd:
134+
name: Build assets - FreeBSD
135+
runs-on: ubuntu-latest
136+
steps:
137+
- uses: actions/checkout@v4
138+
with:
139+
submodules: true
140+
- name: Run in VM
141+
uses: vmactions/freebsd-vm@v1
142+
with:
143+
release: "13.2"
144+
usesh: true
145+
prepare: |
146+
pkg update
147+
pkg install -y python311 rust
148+
run: |
149+
python3.11 -m venv .venv --upgrade-deps
150+
. .venv/bin/activate
151+
pip install -r requirements.txt
152+
pip install .
153+
python setup.py build
154+
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|^./||'")
155+
pip install pyinstaller
156+
pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --copy-metadata codecov-cli --hidden-import staticcodecov_languages -F codecov_cli/main.py
157+
cp ./dist/main ./dist/codecovcli_freebsd
158+
- name: Upload a Build Artifact
159+
uses: actions/[email protected]
160+
if: inputs.release == false
161+
with:
162+
path: ./dist/codecovcli_freebsd
163+
- name: Upload Release Asset
164+
if: inputs.release == true
165+
id: upload-release-asset
166+
uses: svenstaro/upload-release-action@v2
167+
with:
168+
repo_token: ${{ secrets.GITHUB_TOKEN }}
169+
file: ./dist/codecovcli_freebsd
170+
asset_name: codecovcli_freebsd
171+
tag: ${{ github.ref }}
172+
overwrite: true

0 commit comments

Comments
 (0)