Compare commits

..

No commits in common. "master" and "0.2.1" have entirely different histories.

4 changed files with 9 additions and 37 deletions

View File

@ -1,4 +1,4 @@
name: release name: build release
on: on:
push: push:
@ -10,10 +10,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: checkout - name: checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -23,7 +19,7 @@ jobs:
go-version: '1.13.0' go-version: '1.13.0'
- name: Build - name: Build
run: make -j $(nproc) compile VERSION=${{ steps.get_version.outputs.VERSION }} run: make -j $(nproc) compile VERSION=${{ github.ref }}
- name: create release - name: create release
id: create_release id: create_release
@ -31,8 +27,8 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
tag_name: ${{ steps.get_version.outputs.VERSION }} tag_name: ${{ github.ref }}
release_name: Release ${{ steps.get_version.outputs.VERSION }} release_name: Release ${{ github.ref }}
draft: false draft: false
prerelease: false prerelease: false

View File

@ -1,23 +0,0 @@
name: build
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.13.0'
- name: Build
run: make -j $(nproc) compile

View File

@ -17,16 +17,15 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
NAME = $(shell basename $(shell readlink -e .)) NAME = range-gen
VERSION = dev_$(shell date +%F_%T) VERSION = dev_$(shell date +%F_%T)
GOCMD = go GOCMD = go
LDFLAGS := "$(LDFLAGS) -X 'main.Version=$(VERSION)'" LDFLAGS := "$(LDFLAGS) -X 'main.Version=$(VERSION)'"
GOBUILD = $(GOCMD) build -ldflags=$(LDFLAGS) GOBUILD = $(GOCMD) build -ldflags=$(LDFLAGS)
SRCMAIN = ./cmd/$(NAME) SRCMAIN = ./cmd/$(NAME)
SRCDOC = ./doc
BINDIR = bin BINDIR = bin
BIN = $(BINDIR)/$(NAME) BIN = $(BINDIR)/$(NAME)
README = $(SRCDOC)/README README = ./doc/README
LICENSE = LICENSE LICENSE = LICENSE
PREFIX = /usr PREFIX = /usr
@ -42,8 +41,8 @@ build: prep
$(GOBUILD) -o $(BIN) $(SRCMAIN) $(GOBUILD) -o $(BIN) $(SRCMAIN)
doc: check-build doc: check-build
test -d $(SRCDOC) || mkdir $(SRCDOC) test -d ./doc || mkdir ./doc
$(BIN) --help > $(README) $(BIN) --help > ./doc/README
check-build: check-build:
test -e $(BIN) test -e $(BIN)

View File

@ -1,6 +1,6 @@
# Range-Gen # Range-Gen
[![build](https://github.com/GenZmeY/range-gen/workflows/build/badge.svg)](https://github.com/GenZmeY/range-gen/actions) [![build release](https://github.com/GenZmeY/range-gen/workflows/build%20release/badge.svg)](https://github.com/GenZmeY/range-gen/actions)
[![GitHub top language](https://img.shields.io/github/languages/top/GenZmeY/range-gen)](https://golang.org) [![GitHub top language](https://img.shields.io/github/languages/top/GenZmeY/range-gen)](https://golang.org)
[![GitHub](https://img.shields.io/github/license/genzmey/range-gen)](https://www.gnu.org/licenses/gpl-3.0.en.html) [![GitHub](https://img.shields.io/github/license/genzmey/range-gen)](https://www.gnu.org/licenses/gpl-3.0.en.html)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/GenZmeY/range-gen)](https://github.com/GenZmeY/range-gen/releases) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/GenZmeY/range-gen)](https://github.com/GenZmeY/range-gen/releases)