Skip to content

Commit 54f074f

Browse files
committed
Adding release pipeline to github actions
1 parent 7694d99 commit 54f074f

2 files changed

Lines changed: 29 additions & 12 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
1+
name: Release
12
on:
2-
create:
3+
push:
4+
branches:
5+
- "!*"
36
tags:
4-
- v*
5-
name: Packman Release
7+
- "v*.*"
68
jobs:
7-
release-linux-amd64:
8-
name: release linux/amd64
9+
build:
910
runs-on: ubuntu-latest
11+
name: goreleaser
1012
steps:
11-
- uses: actions/checkout@master
12-
- name: compile and release
13-
uses: ngs/go-release.action@v1.0.1
13+
- name: Set up Go 1.13
14+
uses: actions/setup-go@v1
15+
with:
16+
go-version: 1.13
17+
id: go
18+
- name: Check out code into the Go module directory
19+
uses: actions/checkout@v1
20+
- name: Check GITHUB_REF environment variable value
21+
run: echo $GITHUB_REF
22+
- name: Release via goreleaser
23+
uses: goreleaser/goreleaser-action@master
24+
with:
25+
args: release
1426
env:
15-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16-
GOARCH: amd64
17-
GOOS: linux
27+
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}

‎Makefile‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ GOBUILD=$(GOCMD) build
55
GOTEST=$(GOCMD) test
66
GOINSTALL=$(GOCMD) install
77

8+
PLATFORMS=darwin linux windows
9+
ARCHITECTURES=386 amd64
10+
811
build: test
912
$(GOBUILD) -o packman -v main.go
1013
run:
@@ -13,4 +16,8 @@ test:
1316
$(GOTEST) -v ./...
1417

1518
install: build
16-
$(GOINSTALL) -v .
19+
$(GOINSTALL) -v .
20+
21+
release: test
22+
$(foreach GOOS, $(PLATFORMS),\
23+
$(foreach GOARCH, $(ARCHITECTURES), $(shell export GOOS=$(GOOS); export GOARCH=$(GOARCH); go build -v -o packman-$(GOOS)-$(GOARCH))))

0 commit comments

Comments
 (0)
⌂ 换网址