-
Notifications
You must be signed in to change notification settings - Fork 38
61 lines (53 loc) · 1.79 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
59
60
61
name: build
on: [push, create]
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ^1.13
- name: Checkout tags
run: |
git fetch --prune --unshallow
git fetch origin +refs/tags/*:refs/tags/*
- name: Lint
uses: golangci/golangci-lint-action@v3
- name: Lint shell code
run: shellcheck -e SC2155 scripts/bootstrap
- name: Test
run: go test ./...
- name: Build
run: |
GOARCH=amd64 GOOS=windows make && mv dist/dots{,-windows-amd64.exe}
GOARCH=amd64 GOOS=darwin make && mv dist/dots{,-macos-amd64}
GOARCH=arm64 GOOS=darwin make && mv dist/dots{,-macos-arm64}
GOARCH=amd64 GOOS=linux make && mv dist/dots{,-linux-amd64}
- name: Release latest master
if: github.event_name == 'push'
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: dev-build
prerelease: true
title: Development Build
files: |
scripts/bootstrap
dist/dots-linux-amd64
dist/dots-macos-amd64
dist/dots-macos-arm64
dist/dots-windows-amd64.exe
- name: Release tagged version
if: github.event_name == 'create' && startsWith(github.ref, 'refs/tags')
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
scripts/bootstrap
dist/dots-linux-amd64
dist/dots-macos-amd64
dist/dots-macos-arm64
dist/dots-windows-amd64.exe