diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 08c69ef..371d284 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,8 +26,10 @@ jobs: uses: actions/setup-go@v2 with: go-version: '1.17.7' + - name: Download Task + run: 'sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d' - name: Build - run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} make + run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} ./bin/task - uses: actions/upload-artifact@v2 if: matrix.goos == 'windows' with: diff --git a/CHANGELOG.md b/CHANGELOG.md index dd733c6..1a2a091 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # 🎀 Changelog ## Unreleased +**NOTE:** Hilbish now uses [Task] insead of Make for builds. + +[Task]: https://taskfile.dev/#/ + ### Added - Inline hints, akin to fish and the others. To make a handler for hint text, you can set the `hilbish.hinter` function. diff --git a/Makefile b/Makefile deleted file mode 100644 index 40945d3..0000000 --- a/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -PREFIX ?= /usr -BINDIR ?= $(PREFIX)/bin -LIBDIR ?= $(PREFIX)/share/hilbish - -MY_GOFLAGS = -ldflags "-s -w" - -all: dev - -dev: MY_GOFLAGS = -ldflags "-s -w -X main.gitCommit=$(shell git rev-parse --short HEAD) -X main.gitBranch=$(shell git rev-parse --abbrev-ref HEAD)" -dev: build - -build: - go build $(MY_GOFLAGS) - -install: - install -v -d "$(DESTDIR)$(BINDIR)/" && install -m 0755 -v hilbish "$(DESTDIR)$(BINDIR)/hilbish" - mkdir -p "$(DESTDIR)$(LIBDIR)" - cp -r libs docs emmyLuaDocs nature .hilbishrc.lua "$(DESTDIR)$(LIBDIR)" - grep -qxF "$(DESTDIR)$(BINDIR)/hilbish" /etc/shells || echo "$(DESTDIR)$(BINDIR)/hilbish" >> /etc/shells - -uninstall: - rm -vrf \ - "$(DESTDIR)$(BINDIR)/hilbish" \ - "$(DESTDIR)$(LIBDIR)" - sed -i '/hilbish/d' /etc/shells - -clean: - go clean - -.PHONY: all dev build install uninstall clean diff --git a/Taskfile.yaml b/Taskfile.yaml new file mode 100644 index 0000000..067f2ba --- /dev/null +++ b/Taskfile.yaml @@ -0,0 +1,36 @@ +# https://taskfile.dev + +version: '3' + +vars: + PREFIX: '{{default "/usr" .PREFIX}}' + bindir__: '{{.PREFIX}}/bin' + BINDIR: '{{default .bindir__ .BINDIR}}' + libdir__: '{{.PREFIX}}/share/hilbish' + LIBDIR: '{{default .libdir__ .LIBDIR}}' + GOFLAGS: '-ldflags "-s -w"' + +tasks: + default: + cmds: + - go build {{.GOFLAGS}} + vars: + GOFLAGS: '-ldflags "-s -w -X main.gitCommit=$(git rev-parse --short HEAD) -X main.gitBranch=$(git rev-parse --abbrev-ref HEAD)"' + + build: + cmds: + - go build {{.GOFLAGS}} + + install: + cmds: + - install -v -d "{{.DESTDIR}}{{.BINDIR}}/" && install -m 0755 -v hilbish "{{.DESTDIR}}{{.BINDIR}}/hilbish" + - mkdir -p "{{.DESTDIR}}{{.LIBDIR}}" + - cp -r libs docs emmyLuaDocs nature .hilbishrc.lua {{.DESTDIR}}{{.LIBDIR}} + - grep -qxF "{{.DESTDIR}}{{.BINDIR}}/hilbish" /etc/shells || echo "{{.DESTDIR}}{{.BINDIR}}/hilbish" >> /etc/shells + + uninstall: + cmds: + - rm -vrf + "{{.DESTDIR}}{{.BINDIR}}/hilbish" + "{{.DESTDIR}}{{.LIBDIR}}" + - sed -i '/hilbish/d' /etc/shells