Skip to content

Commit

Permalink
build(release): compress web files in github action builds
Browse files Browse the repository at this point in the history
* feat: Compress web files in the GitHub action build
  • Loading branch information
JosephKav committed May 3, 2022
1 parent 6cd458c commit 3d396c0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/build-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,9 @@ jobs:
- name: Build
run: >-
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }}
go build
-ldflags="-X 'github.com/hymenaios-io/Hymenaios/utils.Version=${{ github.event.release.tag_name }}' -X 'github.com/hymenaios-io/Hymenaios/utils.BuildDate=${{ steps.date.outputs.date }}'"
-o ./bin/${{ github.event.release.tag_name }}_${{ matrix.os }}_${{ matrix.arch }}
./cmd/hymenaios
make
OUTPUT_BINARY=./bin/${{ github.event.release.tag_name }}_${{ matrix.os }}_${{ matrix.arch }}
go-build
- name: Upload release asset
id: upload-release-asset
Expand Down
5 changes: 0 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
ARG GO_VERSION="1.18.1"
ARG DEBIAN_VERSION="bullseye"
FROM golang:${GO_VERSION}-${DEBIAN_VERSION}
# Install node for Makefille.common's:
# $(shell node -p "require('./web/ui/react-app/package.json').$(1)")
RUN \
apt-get update && \
apt-get install nodejs -y

COPY . /build/
WORKDIR /build/
Expand Down
7 changes: 5 additions & 2 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ endef
BUILD_DATE ?= ${shell date -u +"%FT%TZ"}
BUILD_VERSION := $(call GetFromPkg,version)

OUTPUT_BINARY ?= hymenaios

# This rule is used to forward a target like "build" to "common-build". This
# allows a new "build" target to be defined in a Makefile which includes this
# one and override "common-build" without override warnings.
Expand Down Expand Up @@ -76,8 +78,9 @@ common-build:
echo '>> building binaries'; \
go build \
-ldflags=\"\
-X 'github.com/hymenaios-io/Hymenaios/utils.Version=${BUILD_VERSION}' \
-X 'github.com/hymenaios-io/Hymenaios/utils.BuildDate=${BUILD_DATE}'\" \
-X 'github.com/hymenaios-io/Hymenaios/utils.Version=${BUILD_VERSION}' \
-X 'github.com/hymenaios-io/Hymenaios/utils.BuildDate=${BUILD_DATE}'\" \
-o ${OUTPUT_BINARY} \
./cmd/hymenaios/"

.PHONY: build-darwin
Expand Down

0 comments on commit 3d396c0

Please sign in to comment.