Streamline workflows [skip ci]

- Shorten the workflow file names, it should be really obvious that this
  is CI
- All platforms now perform the same steps
- Remove redundant git calls which are performed by actions/checkout
- On FreeBSD use the default compiler binary (no version suffix)
This commit is contained in:
nobounce 2023-09-27 11:49:04 +02:00
parent 2c3ac4855d
commit d483b36647
No known key found for this signature in database
GPG key ID: CC8B8C464BDC2F39
4 changed files with 95 additions and 105 deletions

View file

@ -1,69 +0,0 @@
name: Continuous Build MacOS
on:
workflow_dispatch:
push:
branches:
- main
tags-ignore:
- '*.*'
paths:
- 'src/**'
- '!src/linux/**'
- '!src/freebsd/**'
- 'include/**'
- 'Makefile'
- '.github/workflows/continuous-build-macos.yml'
pull_request:
branches:
- main
paths:
- 'src/**'
- '!src/linux/**'
- '!src/freebsd/**'
- 'include/**'
- 'Makefile'
- '.github/workflows/continuous-build-macos.yml'
jobs:
build-macos11:
runs-on: macos-11
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Compile
run: |
make CXX=g++-11 ARCH=x86_64 STATIC=true STRIP=true
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
mv bin/btop bin/btop-x86_64-BigSur-$GIT_HASH
ls -alh bin
- uses: actions/upload-artifact@v3
with:
name: btop-x86_64-macos11-BigSur
path: 'bin/*'
build-macos12:
runs-on: macos-12
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Compile
run: |
make CXX=g++-12 ARCH=x86_64 STATIC=true STRIP=true
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
mv bin/btop bin/btop-x86_64-Monterey-$GIT_HASH
ls -alh bin
- uses: actions/upload-artifact@v3
with:
name: btop-x86_64-macos12-Monterey
path: 'bin/*'

View file

@ -1,4 +1,4 @@
name: Continuous Build FreeBSD
name: FreeBSD Build
on:
workflow_dispatch:
@ -29,26 +29,27 @@ jobs:
build-freebsd:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Checkout source
uses: actions/checkout@v3
- name: Compile
- name: Build
uses: vmactions/freebsd-vm@v0
with:
release: 13.2
usesh: true
prepare: |
pkg install -y gmake gcc11 coreutils git
git config --global --add safe.directory /Users/runner/work/btop/btop
run: |
gmake STATIC=true STRIP=true
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
mv bin/btop bin/btop-$GIT_HASH
ls -alh bin
prepare: pkg install -y gmake gcc coreutils git
- uses: actions/upload-artifact@v3
run: gmake STATIC=true STRIP=true
- name: Create binary artifact
run: |
GIT_HASH=$(git rev-parse --short "${{ github.sha }}")
FILENAME=btop-$GIT_HASH
cp bin/btop bin/$FILENAME
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: btop-x86_64-FreeBSD-13.2
path: 'bin/*'
path: 'bin/btop-*'
if-no-files-found: error

View file

@ -1,4 +1,4 @@
name: Continuous Build Linux
name: Linux Build
on:
workflow_dispatch:
@ -89,37 +89,24 @@ jobs:
- name: Install build tools
run: apk add --no-cache coreutils git make tar zstd
- name: Fix - Unsafe repository stop
run: git config --global --add safe.directory /__w/btop/btop
- name: Checkout source
uses: actions/checkout@v3
with:
submodules: recursive
- name: Fix - Stopping at filesystem boundary
run: git init # [fix Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).]
- name: Build
run: make STATIC=true STRIP=true
- name: Make executable
run: chmod +x bin/*
- name: Set up directories
run: |
mkdir .artifacts
mkdir .package
- name: Create binary atrifacts
- name: Create binary artifact
run: |
# This is only required for containers
git config --global --add safe.directory /__w/btop/btop
TOOLCHAIN=${{ matrix.toolchain }}
GIT_HASH=$(git rev-parse --short "${{ github.sha }}")
FILENAME=btop-${TOOLCHAIN/linux-musl/}-$GIT_HASH
cp bin/btop .artifacts/$FILENAME
cp bin/btop bin/$FILENAME
- name: Upload artifacts
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: btop-${{ matrix.toolchain }}
path: '.artifacts/**'
path: 'bin/btop-*'
if-no-files-found: error

71
.github/workflows/macos.yml vendored Normal file
View file

@ -0,0 +1,71 @@
name: MacOS Build
on:
workflow_dispatch:
push:
branches:
- main
tags-ignore:
- '*.*'
paths:
- 'src/**'
- '!src/linux/**'
- '!src/freebsd/**'
- 'include/**'
- 'Makefile'
- '.github/workflows/continuous-build-macos.yml'
pull_request:
branches:
- main
paths:
- 'src/**'
- '!src/linux/**'
- '!src/freebsd/**'
- 'include/**'
- 'Makefile'
- '.github/workflows/continuous-build-macos.yml'
jobs:
build-macos11:
runs-on: macos-11
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Build
run: make CXX=g++-12 ARCH=x86_64 STATIC=true STRIP=true
- name: Create binary artifact
run: |
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
FILENAME=btop-x86_64-BigSur-$GIT_HASH
cp bin/btop bin/$FILENAME
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: btop-x86_64-macos11-BigSur
path: 'bin/btop-*'
if-no-files-found: error
build-macos12:
runs-on: macos-12
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Build
run: make CXX=g++-12 ARCH=x86_64 STATIC=true STRIP=true
- name: Create binary artifact
run: |
GIT_HASH=$(git rev-parse --short "${{ github.sha }}")
FILENAME=btop-x86_64-Monterey-$GIT_HASH
cp bin/btop bin/$FILENAME
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: btop-x86_64-macos12-Monterey
path: 'bin/btop-*'
if-no-files-found: error