Skip to content

Commit 60ca8ec

Browse files
committed
github actions
1 parent 8f84d5a commit 60ca8ec

File tree

2 files changed

+46
-4
lines changed

2 files changed

+46
-4
lines changed

.github/workflows/go.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
server-go:
11+
runs-on: ubuntu-latest
12+
steps:
13+
-
14+
name: Checkout
15+
uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
-
19+
name: Set up Go
20+
uses: actions/setup-go@v2
21+
with:
22+
go-version: 1.15
23+
- name: Install Snapcraft
24+
run: |
25+
sudo snap install snapcraft --classic
26+
echo ${{ secrets.SNAPCRAFT_TOKEN }} | snapcraft login --with -
27+
-
28+
name: Login to Docker Hub
29+
uses: docker/login-action@v1
30+
with:
31+
username: openiothub
32+
password: ${{ secrets.DOCKERHUB_TOKEN }}
33+
-
34+
name: Run GoReleaser
35+
uses: goreleaser/goreleaser-action@v2
36+
with:
37+
version: latest
38+
args: release --rm-dist
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,12 @@ nfpms:
7878
postinstall: "scripts/install_remove/postinstall.sh"
7979
preremove: "scripts/install_remove/preremove.sh"
8080
postremove: "scripts/install_remove/postremove.sh"
81-
files:
82-
"systemd/**": "/etc/systemd/system"
83-
config_files:
84-
"server-go.yaml": "/etc/server-go/server-go.yaml"
81+
contents:
82+
- src: systemd/**
83+
dst: /etc/systemd/system
84+
- src: server-go.yaml
85+
dst: /etc/server-go/server-go.yaml
86+
type: config
8587
snapcrafts:
8688
- name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}'
8789
summary: OpenIoTHub Server.

0 commit comments

Comments
 (0)