Skip to content

Commit

Permalink
Refactor Makefile and GitHub Actions workflow to improve dependency c…
Browse files Browse the repository at this point in the history
…hecks and streamline build process
  • Loading branch information
qianlifeng committed Dec 19, 2024
1 parent d6cefe8 commit cfa7cb1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ jobs:
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Build
run: make publish
env:
Expand Down
21 changes: 14 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,22 @@ help:

_check_deps:
@echo "Checking required dependencies..."
@command -v go >/dev/null 2>&1 || { echo "go is required but not installed. Visit https://golang.org/doc/install" >&2; exit 1; }
@command -v flutter >/dev/null 2>&1 || { echo "flutter is required but not installed. Visit https://flutter.dev/docs/get-started/install" >&2; exit 1; }
@command -v node >/dev/null 2>&1 || { echo "nodejs is required but not installed. Visit https://nodejs.org/" >&2; exit 1; }
@command -v pnpm >/dev/null 2>&1 || { echo "pnpm is required but not installed. Run: npm install -g pnpm" >&2; exit 1; }
@command -v uv >/dev/null 2>&1 || { echo "uv is required but not installed. Visit https://github.com/astral-sh/uv" >&2; exit 1; }
@command -v go >/dev/null 2>&1 || { echo "go is required but not installed. Visit https://golang.org/doc/install" >&2; exit 1; }
@command -v flutter >/dev/null 2>&1 || { echo "flutter is required but not installed. Visit https://flutter.dev/docs/get-started/install" >&2; exit 1; }
@command -v node >/dev/null 2>&1 || { echo "nodejs is required but not installed. Visit https://nodejs.org/" >&2; exit 1; }
@command -v pnpm >/dev/null 2>&1 || { echo "pnpm is required but not installed. Run: npm install -g pnpm" >&2; exit 1; }
@command -v uv >/dev/null 2>&1 || { echo "uv is required but not installed. Visit https://github.com/astral-sh/uv" >&2; exit 1; }
ifeq ($(PLATFORM),macos)
@command -v create-dmg >/dev/null 2>&1 || { echo "create-dmg is required but not installed. Visit https://github.com/create-dmg/create-dmg" >&2; exit 1; }
@command -v create-dmg >/dev/null 2>&1 || { echo "create-dmg is required but not installed. Visit https://github.com/create-dmg/create-dmg" >&2; exit 1; }
else
@command -v upx >/dev/null 2>&1 || { echo "❌ upx is required but not installed. Visit https://upx.github.io/" >&2; exit 1; }
@command -v upx >/dev/null 2>&1 || { echo "upx is required but not installed. Visit https://upx.github.io/" >&2; exit 1; }
endif

ifeq ($(PLATFORM),windows)
@if not "$(shell echo $(shell uname -s) | grep -q '^MINGW64_NT' && echo yes || echo no)" == "yes" ; then \
echo "Please run this command in MINGW64 environment. If you have not installed MINGW64, please install it first. refer to https://www.mingw-w64.org/downloads/ or scoop install mingw" >&2; \
exit 1; \
fi
endif

clean:
Expand Down

0 comments on commit cfa7cb1

Please sign in to comment.