Skip to content

Commit 63ff6cc

Browse files
authored
Merge pull request #186 from meshplus/build/add-auto-release-scripts
ci: add release.yml and some scripts
2 parents 0cf0175 + b51bea3 commit 63ff6cc

File tree

4 files changed

+64
-1
lines changed

4 files changed

+64
-1
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
release:
10+
name: Build Release on Linux and Macos
11+
runs-on: ${{matrix.os}}
12+
strategy:
13+
matrix:
14+
os: [macos-latest, ubuntu-latest]
15+
steps:
16+
- name: Set up Go
17+
uses: actions/setup-go@v2
18+
with:
19+
go-version: 1.13
20+
21+
- name: Check out code
22+
uses: actions/checkout@v2
23+
24+
- name: Build Binary
25+
run: make release-binary
26+
27+
- name: Release Binary
28+
uses: softprops/action-gh-release@v1
29+
with:
30+
files: bin/**.tar.gz
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
SHELL := /bin/bash
33
CURRENT_PATH = $(shell pwd)
44
APP_NAME = pier
5-
APP_VERSION = 1.5.0
5+
APP_VERSION = 1.6.0
66

77
# build with verison infos
88
VERSION_DIR = github.com/meshplus/${APP_NAME}
@@ -86,6 +86,10 @@ docker-build: packr
8686
build-linux:
8787
cd scripts && bash cross_compile.sh linux-amd64 ${CURRENT_PATH}
8888

89+
## make release: Build release before push
90+
release-binary:
91+
@cd scripts && bash release_binary.sh '${APP_VERSION}'
92+
8993
## make linter: Run golanci-lint
9094
linter:
9195
golangci-lint run

build/libwasmer.dylib

3.42 MB
Binary file not shown.

scripts/release_binary.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
source x.sh
5+
6+
CURRENT_PATH=$(pwd)
7+
PROJECT_PATH=$(dirname "${CURRENT_PATH}")
8+
RELEASE_PATH=${PROJECT_PATH}/bin
9+
APP_VERSION=${1:-'1.6.0'}
10+
11+
print_blue "===> 1. Install packr"
12+
if ! type packr >/dev/null 2>&1; then
13+
go get -u github.com/gobuffalo/packr/packr
14+
fi
15+
16+
print_blue "===> 2. build pier"
17+
cd "${PROJECT_PATH}" && make build
18+
19+
print_blue "===> 3. pack binarys"
20+
cd "${RELEASE_PATH}"
21+
if [ "$(uname)" == "Darwin" ]; then
22+
cp ../build/libwasmer.dylib .
23+
tar zcvf pier_v"${APP_VERSION}"_Darwin_x86_64.tar.gz ./pier ./libwasmer.dylib
24+
else
25+
cp ../build/libwasmer.so .
26+
tar zcvf pier_v"${APP_VERSION}"_Linux_x86_64.tar.gz ./pier ./libwasmer.so
27+
fi

0 commit comments

Comments
 (0)