Skip to content

Commit f89260a

Browse files
committed
build: consolidate GoReleaser config and update binary name
1 parent da7022a commit f89260a

File tree

5 files changed

+28
-122
lines changed

5 files changed

+28
-122
lines changed

.goreleaser-for-darwin.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.goreleaser-for-linux.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.goreleaser.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ version: 2
77
before:
88
hooks:
99
- |
10-
sh -c '
11-
if [ "$SKIP_GORELEASER_TESTS" = "true" ]; then
12-
echo "Skipping tests (SKIP_GORELEASER_TESTS=true)"
13-
else
14-
magex test
15-
fi
16-
'
10+
sh -c "if [ \"${SKIP_GORELEASER_TESTS}\" = \"true\" ]; then
11+
echo 'Skipping tests (SKIP_GORELEASER_TESTS=true)'
12+
else
13+
magex test
14+
fi"
1715
changelog:
1816
sort: asc
1917
filters:
@@ -25,13 +23,28 @@ changelog:
2523
# Builder
2624
# ---------------------------
2725
builds:
28-
- env:
26+
- id: go-alert-system
27+
main: ./cmd/go-alert-system
28+
binary: go-alert-system
29+
env:
2930
- CGO_ENABLED=0
3031
goos:
3132
- linux
32-
- windows
3333
- darwin
34-
skip: true
34+
- windows
35+
goarch:
36+
- amd64
37+
- arm64
38+
overrides:
39+
- goos: linux
40+
goarch: arm64
41+
env:
42+
- CC=aarch64-linux-gnu-gcc
43+
ldflags:
44+
- -s -w
45+
- -X main.version={{.Version}}
46+
- -X main.commit={{.Commit}}
47+
- -X main.buildDate={{.Date}}
3548

3649
# ---------------------------
3750
# Archives

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ COPY cmd/ cmd/
77
COPY utils/ utils/
88
COPY go.mod go.mod
99
COPY go.sum go.sum
10-
RUN CGO_ENABLED=0 go build -a -o $APP_ROOT/src/alert-system github.com/bsv-blockchain/go-alert-system/cmd
10+
RUN CGO_ENABLED=0 go build -a -o $APP_ROOT/src/go-alert-system github.com/bsv-blockchain/go-alert-system/cmd/go-alert-system
1111

1212
# Copy the controller-manager into a thin image
1313
FROM registry.access.redhat.com/ubi9-minimal:9.3
1414
WORKDIR /
1515
RUN mkdir /.bitcoin
1616
RUN touch /.bitcoin/alert_system_private_key
17-
COPY --from=builder /opt/app-root/src/alert-system .
17+
COPY --from=builder /opt/app-root/src/go-alert-system .
1818
USER 65534:65534
1919
ENV ALERT_SYSTEM_ENVIRONMENT=local
20-
CMD ["/alert-system"]
20+
CMD ["/go-alert-system"]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@
9494

9595
To run the application, clone this repository locally and run:
9696
```shell script
97-
export ALERT_SYSTEM_ENVIRONMENT=testnet && go run cmd/main.go
97+
export ALERT_SYSTEM_ENVIRONMENT=testnet && go run cmd/go-alert-system/main.go
9898
```
9999

100100
To run this application with a custom configuration file, run:
101101
```shell script
102-
export ALERT_SYSTEM_CONFIG_FILEPATH=path/to/file/config.json && go run cmd/main.go
102+
export ALERT_SYSTEM_CONFIG_FILEPATH=path/to/file/config.json && go run cmd/go-alert-system/main.go
103103
```
104104

105105
Configuration files can be found in the [config](app/config/envs) directory.

0 commit comments

Comments
 (0)