Skip to content

Re-enable bundle + plugin upload fix #14

Re-enable bundle + plugin upload fix

Re-enable bundle + plugin upload fix #14

Workflow file for this run

name: Build btop
on:
workflow_dispatch:
inputs:
debug_build:
required: false
type: boolean
debug_link:
required: false
type: boolean
push:
branches: ["main"]
pull_request:
workflow_call:
jobs:
build:
name: Build btop
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Load cosmocc version
run: |
version=$(cat .github/cosmocc_version.txt)
echo "cosmocc_version=${version}" >> "$GITHUB_ENV"
- name: Setup cosmocc
uses: bjia56/[email protected]
with:
version: ${{ env.cosmocc_version }}
- name: Build btop
run: |
export CC=cosmocc
export CXX=cosmoc++
cmake -B build
cmake --build build --parallel 4
- name: Upload btop
uses: actions/upload-artifact@v4
with:
name: btop
path: ./build/btop
- name: Interactive debugging
uses: fawazahmed0/action-debug-vscode@v3
if: ${{ always() && inputs.debug_build }}
build_plugin:
name: Build btop plugin ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
#- runner: macos-13
# arch: x86_64
# os: MacOS
#- runner: macos-14
# arch: arm64
# os: MacOS
- runner: ubuntu-latest
arch: x86_64
os: Linux
#- runner: windows-latest
# arch: x86_64
# os: Windows
#- runner: ubuntu-latest
# arch: x86_64
# os: FreeBSD
#- runner: ubuntu-latest
# arch: aarch64
# os: FreeBSD
#- runner: ubuntu-latest
# arch: x86_64
# os: NetBSD
#- runner: ubuntu-latest
# arch: x86_64
# os: OpenBSD
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build plugin
if: ${{ !contains(matrix.os, 'BSD') }}
shell: bash
run: |
cd src/linux
cmake -B build
cmake --build build --parallel 4
cp build/libbtop.so ${{ github.workspace }}/libbtop-${{ matrix.os }}-${{ matrix.arch }}
- name: Start VM
if: ${{ matrix.os == 'FreeBSD' }}
uses: vmactions/freebsd-vm@v1
with:
sync: nfs
arch: ${{ matrix.arch }}
- name: Start VM
if: ${{ matrix.os == 'NetBSD' }}
uses: vmactions/netbsd-vm@v1
with:
sync: nfs
- name: Start VM
if: ${{ matrix.os == 'OpenBSD' }}
uses: vmactions/openbsd-vm@v1
with:
sync: nfs
release: 7.3
- name: todo
if: ${{ matrix.os == 'FreeBSD' }}
shell: freebsd {0}
run: |
cd ${{ github.workspace }}
./btop.com --version
- name: todo
if: ${{ matrix.os == 'NetBSD' }}
shell: netbsd {0}
run: |
cd ${{ github.workspace }}
./btop.com --version
- name: todo
if: ${{ matrix.os == 'OpenBSD' }}
shell: openbsd {0}
run: |
cd ${{ github.workspace }}
./btop.com --version
- name: Upload plugin
uses: actions/upload-artifact@v4
with:
name: btop-plugin-${{ matrix.os}}-${{ matrix.arch }}
path: ./libbtop-${{ matrix.os }}-${{ matrix.arch }}
bundle:
name: Bundle plugins with btop
runs-on: ubuntu-latest
needs: [build, build_plugin]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Load cosmocc version
run: |
version=$(cat .github/cosmocc_version.txt)
echo "cosmocc_version=${version}" >> "$GITHUB_ENV"
- name: Setup cosmocc
uses: bjia56/[email protected]
with:
version: ${{ env.cosmocc_version }}
- name: Download btop
uses: actions/download-artifact@v4
with:
name: btop
path: .
- name: Download btop plugins
uses: actions/download-artifact@v4
with:
pattern: btop-plugin-*
path: /tmp/btop-plugin/
merge-multiple: true
- name: Bundle
run: |
tree /tmp/btop-plugin || true
mv btop btop.com
sudo mkdir -p /zip/x86_64/linux
sudo mkdir -p /zip/x86_64/macos
sudo mkdir -p /zip/x86_64/windows
sudo mkdir -p /zip/x86_64/freebsd
sudo mkdir -p /zip/x86_64/openbsd
sudo mkdir -p /zip/x86_64/netbsd
sudo mkdir -p /zip/aarch64/linux
sudo mkdir -p /zip/aarch64/macos
sudo mkdir -p /zip/aarch64/windows
sudo mkdir -p /zip/aarch64/freebsd
sudo mkdir -p /zip/aarch64/openbsd
sudo mkdir -p /zip/aarch64/netbsd
cd /zip
zip -qr ${{ github.workspace }}/btop.com *
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: btop.com
path: ./btop.com
- name: Interactive debugging
uses: fawazahmed0/action-debug-vscode@v3
if: ${{ always() && inputs.debug_link }}
check:
name: Check btop.com ${{ matrix.os }} ${{ matrix.arch }}
needs: bundle
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- runner: macos-13
arch: x86_64
os: MacOS
- runner: macos-14
arch: arm64
os: MacOS
- runner: ubuntu-latest
arch: x86_64
os: Linux
- runner: windows-latest
arch: x86_64
os: Windows
- runner: ubuntu-latest
arch: x86_64
os: FreeBSD
- runner: ubuntu-latest
arch: aarch64
os: FreeBSD
- runner: ubuntu-latest
arch: x86_64
os: NetBSD
- runner: ubuntu-latest
arch: x86_64
os: OpenBSD
steps:
- name: Set up cosmocc
if: ${{ matrix.os == 'Linux' }}
uses: bjia56/[email protected]
- name: Checkout
uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: btop.com
path: .
- name: Mark executable
shell: bash
run: |
chmod +x btop.com
- name: Configure Windows
if: ${{ matrix.os == 'Windows' }}
shell: powershell
run: |
Remove-MpPreference -ExclusionPath (Get-MpPreference).ExclusionPath
Set-Service -Name wuauserv -StartupType Manual -Status Running
- name: Scan with Windows Defender
if: ${{ matrix.os == 'Windows' }}
shell: cmd
run: |
copy btop.com C:
"C:\Program Files\Windows Defender\MpCmdRun.exe" -SignatureUpdate
"C:\Program Files\Windows Defender\MpCmdRun.exe" -Scan -ScanType 3 -File C:\btop.com
- name: Check btop.com
if: ${{ !contains(matrix.os, 'BSD') }}
shell: bash
run: |
./btop.com --version
- name: Start VM
if: ${{ matrix.os == 'FreeBSD' }}
uses: vmactions/freebsd-vm@v1
with:
sync: nfs
arch: ${{ matrix.arch }}
- name: Start VM
if: ${{ matrix.os == 'NetBSD' }}
uses: vmactions/netbsd-vm@v1
with:
sync: nfs
- name: Start VM
if: ${{ matrix.os == 'OpenBSD' }}
uses: vmactions/openbsd-vm@v1
with:
sync: nfs
release: 7.3
- name: Check btop.com
if: ${{ matrix.os == 'FreeBSD' }}
shell: freebsd {0}
run: |
cd ${{ github.workspace }}
./btop.com --version
- name: Check btop.com
if: ${{ matrix.os == 'NetBSD' }}
shell: netbsd {0}
run: |
cd ${{ github.workspace }}
./btop.com --version
- name: Check btop.com
if: ${{ matrix.os == 'OpenBSD' }}
shell: openbsd {0}
run: |
cd ${{ github.workspace }}
./btop.com --version