Add release pipeline
parent
161ec76eb9
commit
bbf29104fe
|
@ -16,13 +16,9 @@ jobs:
|
|||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ^1.15
|
||||
- name: Check out code
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Build
|
||||
run: make build
|
||||
run: make build-all
|
||||
- name: Test
|
||||
run: make test-with-coverage
|
||||
# - uses: codecov/codecov-action@v1
|
||||
# with:
|
||||
# token: ${{ secrets.CODECOV_TOKEN }}
|
||||
# files: coverage.out
|
||||
run: make test
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
name: Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*.*.*"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Build
|
||||
run: make build-all
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: |
|
||||
bin/edgeboxctl-linux-amd64
|
||||
bin/edgeboxctl-linux-arm
|
21
Makefile
21
Makefile
|
@ -6,14 +6,14 @@ BUILD_DATE := $(shell date -u '+%Y-%m-%d_%H:%M:%S')
|
|||
BUILD_DIR = bin
|
||||
|
||||
build-all:
|
||||
GOOS=linux GOARCH=amd64 make build
|
||||
make build-arm
|
||||
make build-amd64
|
||||
|
||||
build-arm:
|
||||
GOOS=linux GOARCH=arm make build
|
||||
|
||||
build-prod:
|
||||
GOOS=linux GOARCH=arm RELEASE=prod make build
|
||||
|
||||
build-cloud:
|
||||
GOOS=linux GOARCH=amd64 RELEASE=cloud make build
|
||||
build-amd64:
|
||||
GOOS=linux GOARCH=amd64 make build
|
||||
|
||||
build:
|
||||
@echo "Building ${GOOS}-${GOARCH}"
|
||||
|
@ -22,7 +22,6 @@ build:
|
|||
-X ${PROJECT}/internal/diagnostics.Commit=${COMMIT} \
|
||||
-X ${PROJECT}/internal/diagnostics.BuildDate=${BUILD_DATE}" \
|
||||
-o bin/edgeboxctl-${GOOS}-${GOARCH} ${PROJECT}/cmd/edgeboxctl
|
||||
cp ./bin/edgeboxctl-${GOOS}-${GOARCH} ./bin/edgeboxctl
|
||||
|
||||
clean:
|
||||
rm -rf ${BUILD_DIR}
|
||||
|
@ -34,15 +33,15 @@ test:
|
|||
test-with-coverage:
|
||||
go test -tags=unit -timeout=600s -v ./... -coverprofile=coverage.out
|
||||
|
||||
install-cloud: build-cloud
|
||||
cp ./bin/edgeboxctl /usr/local/bin/edgeboxctl
|
||||
install-cloud: build-amd64
|
||||
cp ./bin/edgeboxctl-amd64 /usr/local/bin/edgeboxctl
|
||||
cp ./edgeboxctl/edgeboxctl.service /lib/systemd/system/edgeboxctl.service
|
||||
systemctl daemon-reload
|
||||
@echo "Edgeboxctl installed successfully"
|
||||
@echo "To start edgeboxctl run: systemctl start edgeboxctl"
|
||||
|
||||
install-prod: build-prod
|
||||
cp ./bin/edgeboxctl /usr/local/bin/edgeboxctl
|
||||
install-prod: build-arm
|
||||
cp ./bin/edgeboxctl-arm /usr/local/bin/edgeboxctl
|
||||
cp ./edgeboxctl/edgeboxctl.service /lib/systemd/system/edgeboxctl.service
|
||||
systemctl daemon-reload
|
||||
@echo "Edgeboxctl installed successfully"
|
||||
|
|
Loading…
Reference in New Issue