This repository has been archived by the owner on Mar 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from httprunner/build_publish
v0.2.0
- Loading branch information
Showing
10 changed files
with
84 additions
and
8 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,31 @@ | ||
name: Release hrp cli binaries | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
releases-matrix: | ||
name: Release hrp cli binaries | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
# build and publish in parallel: linux/amd64/windows | ||
goos: [linux, windows, darwin] | ||
goarch: [amd64, arm64] | ||
exclude: | ||
- goarch: arm64 | ||
goos: windows | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Release hrp cli binaries | ||
uses: wangyoucao577/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
goos: ${{ matrix.goos }} | ||
goarch: ${{ matrix.goarch }} | ||
project_path: "./hrp" # go build ./hrp/main.go | ||
binary_name: "hrp" | ||
ldflags: "-s -w" | ||
extra_files: LICENSE docs/README.md docs/CHANGELOG.md |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
SHELL=/usr/bin/env bash | ||
|
||
.DEFAULT_GOAL=help | ||
|
||
.PHONY: test | ||
test: ## run unit tests | ||
@echo "[info] run unit tests" | ||
@echo "go test -race -v ./..." | ||
@go test -race -v ./... | ||
|
||
.PHONY: build | ||
build: ## build hrp cli tool | ||
@echo "[info] build hrp cli tool" | ||
@. hrp/scripts/build.sh | ||
|
||
.PHONY: help | ||
help: ## print make commands | ||
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \ | ||
cut -d ":" -f1- | \ | ||
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
# build hrp cli binary for testing | ||
# release will be triggered on github actions, see .github/workflows/release.yml | ||
|
||
# Usage: | ||
# $ make build | ||
# or | ||
# $ bash hrp/scripts/build.sh | ||
|
||
set -e | ||
set -x | ||
|
||
# prepare path | ||
mkdir -p "output" | ||
bin_path="output/hrp" | ||
|
||
# build | ||
go build -ldflags '-s -w' -o "$bin_path" hrp/main.go | ||
|
||
# check output and version | ||
ls -lh "$bin_path" | ||
chmod +x "$bin_path" | ||
./"$bin_path" -v |
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,3 +1,3 @@ | ||
package hrp | ||
|
||
const VERSION = "v0.1.0" | ||
const VERSION = "v0.2.0" |