-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.62 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Go
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Extract repository name
shell: bash
run: echo "##[set-output name=repo;]$(echo ${GITHUB_REPOSITORY##*/})"
id: extract_repo
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: |
go mod download
- name: Build
run: |
GOOS=linux GOARCH=amd64 go build -v -o ${GITHUB_REPOSITORY##*/}-linux-x64 ./cmd/...
GOOS=linux GOARCH=arm GOARM=5 go build -v -o ${GITHUB_REPOSITORY##*/}-linux-armv5 ./cmd/...
GOOS=linux GOARCH=mipsle go build -v -o ${GITHUB_REPOSITORY##*/}-linux-mipsle ./cmd/...
GOOS=windows GOARCH=amd64 go build -v -o ${GITHUB_REPOSITORY##*/}-win32-x64 ./cmd/...
GOOS=windows GOARCH=386 go build -v -o ${GITHUB_REPOSITORY##*/}-win32-ia32 ./cmd/...
- name: Generate changelog
run: |
npm install -g conventional-changelog-cli
conventional-changelog -p angular -i CHANGELOG.md -s -r 0 -v
- uses: ncipollo/release-action@v1
with:
artifacts: ${{ steps.extract_repo.outputs.repo }}-*
bodyFile: "CHANGELOG.md"
token: ${{ secrets.GITHUB_TOKEN }}