Skip to content

Commit

Permalink
build(go): ➕ add mage as tools dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuar committed Oct 9, 2024
1 parent fbf4040 commit 6d3a074
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 0 additions & 4 deletions .devcontainer/postCreate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ set -e
sudo ./build/scripts/enable-multiarch all
sudo ./build/scripts/install-build-deps all ubuntu

# Install go build packages
go install github.com/magefile/mage@9e91a03eaa438d0d077aca5654c7757141536a60 # v1.15.0
go install github.com/sigstore/cosign/v2/cmd/cosign@b5e7dc123a272080f4af4554054797296271e902 # v2.4.0

# Install and configure starship
curl -sS https://starship.rs/install.sh | sh -s -- -y || exit -1
mkdir -p ~/.config/fish
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -931,15 +931,14 @@ disruptive actions on a device that another user is accessing.

### Build Requirements

Go Hass Agent uses [Mage](https://magefile.org/) for development. Make sure you
follow the instructions on the Mage website to install Mage.
Go Hass Agent uses [Mage](https://magefile.org/) for development.

### Compiling

Use the following mage invocation in the project root directory:

```shell
mage -d build/magefiles -w . build:full
go run github.com/magefile/mage -d build/magefiles -w . build:full
```

This will:
Expand Down Expand Up @@ -968,7 +967,7 @@ export TARGETPLATFORM=linux/arm64 # or linux/arm/v6 or linux/arm/v7
Install the target architecture libraries for cross-compilation:

```shell
mage -d build/magefiles -w . preps:deps
go run github.com/magefile/mage -d build/magefiles -w . preps:deps
```

Then the commands for building and packaging above should work as expected.
Expand All @@ -987,7 +986,7 @@ packages for Fedora, Arch, and Ubuntu/Debian.
To build packages, use the following invocations:

```shell
mage -v -d build/magefiles -w . package:nfpm
go run github.com/magefile/mage -d build/magefiles -w . package:nfpm
```

The above mage actions will install the necessary tooling for packaging, if
Expand Down
1 change: 1 addition & 0 deletions tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package main
import (
_ "github.com/davecgh/go-spew/spew"
_ "github.com/goreleaser/nfpm/v2/cmd/nfpm"
_ "github.com/magefile/mage"
_ "github.com/matryer/moq"
_ "github.com/yassinebenaid/godump"
_ "golang.org/x/tools/cmd/stringer"
Expand Down

0 comments on commit 6d3a074

Please sign in to comment.