Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
build: add Makefile for building and distributing tetgen
Browse files Browse the repository at this point in the history
- Added a Makefile to build and distribute the tetgen library.
- The Makefile includes targets for cleaning, extracting source files, building the library, and creating a distribution package.
- The Makefile also handles different operating systems and architectures for compatibility.
- The Makefile downloads the necessary source files for building the tetgen library from the specified URL.
- The Makefile simplifies the build and distribution process for the tetgen library.
  • Loading branch information
liblaf committed Feb 25, 2024
1 parent 9416e81 commit 446c47f
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 73 deletions.
5 changes: 5 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"words": ["bidi", "choco", "commitizen", "coreutils", "liblaf"],
"ignorePaths": [".cspell.json", "*-lock.*", "*.lock"],
"allowCompoundWords": true
}
26 changes: 11 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,21 @@ name: CI
on:
push:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ github.token }}
- name: Install GNU Softwares
uses: liblaf/template/.github/actions/install@main
- name: Install Tools
uses: liblaf/repo/.github/actions/install@main
with:
brew: coreutils gnu-tar make wget
choco: gnuwin32-coreutils.install make wget
- name: Build
run: task dist
- name: Upload Artifact
run: make dist
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-${{ runner.arch }}
Expand All @@ -44,20 +37,23 @@ jobs:
- build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
- id: version
name: Read Version
name: Get Version
run: echo "version=$(cat version.txt)" >> "$GITHUB_OUTPUT"
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Create GitHub Release
uses: liblaf/template/.github/actions/release@main
uses: liblaf/repo/.github/actions/release@main
with:
tag: v${{ steps.version.outputs.version }}
files: |
artifacts/*
files: "artifacts/*"
recreate: true
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
NAME := tetgen
SRC_DIR := tetgen1.6.0

RUNNER_OS ?= $(shell uname -s)
RUNNER_ARCH ?= $(shell uname -m)

override RUNNER_OS != echo "$(RUNNER_OS)" | tr '[:upper:]' '[:lower:]'
override RUNNER_ARCH != echo "$(RUNNER_ARCH)" | tr '[:upper:]' '[:lower:]'

EXE := $(if $(filter windows,$(RUNNER_OS)),.exe,)

default: $(SRC_DIR)/$(NAME)$(EXE)

clean:
git clean -d --force -X

dist: dist/$(NAME)-$(RUNNER_OS)-$(RUNNER_ARCH)$(EXE)

#####################
# Auxiliary Targets #
#####################

$(SRC_DIR): tetgen1.6.0.tar.gz
tar --extract --file="$<" --gzip --verbose

.PHONY: $(SRC_DIR)/$(NAME)$(EXE)
$(SRC_DIR)/$(NAME)$(EXE): $(SRC_DIR)
$(MAKE) --directory="$<"

dist/$(NAME)-$(RUNNER_OS)-$(RUNNER_ARCH)$(EXE): $(SRC_DIR)/$(NAME)$(EXE)
@ install -D --no-target-directory --verbose "$<" "$@"

tetgen1.6.0.tar.gz:
wget --output-document="$@" "https://wias-berlin.de/software/tetgen/1.5/src/tetgen1.6.0.tar.gz"
44 changes: 0 additions & 44 deletions Taskfile.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions cspell.json

This file was deleted.

0 comments on commit 446c47f

Please sign in to comment.