-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/1.0.4' into 'main'
Release/1.0.4 See merge request opensource/answer!437
- Loading branch information
Showing
68 changed files
with
2,262 additions
and
665 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: "Goreleaser" | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: [self-hosted, linux] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Node Build | ||
run: make install-ui-packages ui | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: answer | ||
path: ./dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,32 @@ | ||
.PHONY: build clean ui | ||
|
||
VERSION=1.0.3 | ||
VERSION=1.0.4 | ||
BIN=answer | ||
DIR_SRC=./cmd/answer | ||
DOCKER_CMD=docker | ||
|
||
#GO_ENV=CGO_ENABLED=0 | ||
GO_ENV=CGO_ENABLED=0 GO111MODULE=on | ||
Revision=$(shell git rev-parse --short HEAD) | ||
GO_FLAGS=-ldflags="-X main.Version=$(VERSION) -X 'main.Revision=$(Revision)' -X 'main.Time=`date`' -extldflags -static" | ||
GO=$(GO_ENV) $(shell which go) | ||
|
||
build: | ||
@$(GO_ENV) $(GO) build $(GO_FLAGS) -o $(BIN) $(DIR_SRC) | ||
build: generate | ||
@$(GO) build $(GO_FLAGS) -o $(BIN) $(DIR_SRC) | ||
|
||
# https://dev.to/thewraven/universal-macos-binaries-with-go-1-16-3mm3 | ||
universal: | ||
universal: generate | ||
@GOOS=darwin GOARCH=amd64 $(GO_ENV) $(GO) build $(GO_FLAGS) -o ${BIN}_amd64 $(DIR_SRC) | ||
@GOOS=darwin GOARCH=arm64 $(GO_ENV) $(GO) build $(GO_FLAGS) -o ${BIN}_arm64 $(DIR_SRC) | ||
@lipo -create -output ${BIN} ${BIN}_amd64 ${BIN}_arm64 | ||
@rm -f ${BIN}_amd64 ${BIN}_arm64 | ||
|
||
generate: | ||
go get github.com/google/wire/cmd/wire@latest | ||
go install github.com/golang/mock/[email protected] | ||
go generate ./... | ||
go mod tidy | ||
@$(GO) get github.com/google/wire/cmd/[email protected] | ||
@$(GO) get github.com/golang/mock/[email protected] | ||
@$(GO) install github.com/google/wire/cmd/[email protected] | ||
@$(GO) install github.com/golang/mock/[email protected] | ||
@$(GO) generate ./... | ||
@$(GO) mod tidy | ||
|
||
test: | ||
@$(GO) test ./internal/repo/repo_test | ||
|
@@ -39,6 +41,6 @@ install-ui-packages: | |
@corepack prepare [email protected] --activate | ||
|
||
ui: | ||
@cd ui && pnpm install && pnpm build && cd - | ||
@cd ui && pnpm install && pnpm build && sed -i 's/%AnswerVersion%/'$(VERSION)'/g' ./build/index.html && cd - | ||
|
||
all: clean build |
Oops, something went wrong.