diff --git a/.github/workflows/continuous-build-macos.yml b/.github/workflows/continuous-build-macos.yml deleted file mode 100644 index 717e9a7..0000000 --- a/.github/workflows/continuous-build-macos.yml +++ /dev/null @@ -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/*' diff --git a/.github/workflows/continuous-build-freebsd.yml b/.github/workflows/freebsd.yml similarity index 57% rename from .github/workflows/continuous-build-freebsd.yml rename to .github/workflows/freebsd.yml index 5caa6d1..a25b50a 100644 --- a/.github/workflows/continuous-build-freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -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 diff --git a/.github/workflows/continuous-build-linux.yml b/.github/workflows/linux.yml similarity index 80% rename from .github/workflows/continuous-build-linux.yml rename to .github/workflows/linux.yml index 3ef236c..05dd4ff 100644 --- a/.github/workflows/continuous-build-linux.yml +++ b/.github/workflows/linux.yml @@ -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 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000..e6f79fa --- /dev/null +++ b/.github/workflows/macos.yml @@ -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