summaryrefslogtreecommitdiff
path: root/.github/workflows/release.yml
blob: a898d96f69d0b9e27a4bdaeaadfb067135798056 (plain)
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
62
name: Go

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:

  build:
    name: Build
    runs-on: ubuntu-latest
    env:
      GOARCH: amd64
    steps:

    - name: Set up Go 1.17
      uses: actions/setup-go@v2
      with:
        go-version: 1.17
      id: go

    - name: Checkout
      uses: actions/checkout@v2

    - name: Get dependencies
      run: go get -v -t -d ./...

    - name: Build (Windows)
      run: go build -v ./...
      env:
        GOOS: windows
    
    - name: Build (Linux)
      run: go build -v ./...
    
    - name: Test
      run: go test -v ./...

    - name: Vet
      run: go vet ./...

    - name: Release Build (Linux)
      run: go build -ldflags '-s -w' -o bin/enguarde-importer
      env:
        GOOS: windows
    
    - name: Release Build (Windows)
      run: go build -ldflags '-s -w -H=windowsgui' -o bin/enguarde-importer.exe
      env:
        GOOS: windows

    - name: Upload Release
      uses: ColinPitrat/update-release@v1.0.1
      id: update-release
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        files: bin/enguarde-importer bin/enguarde-importer.exe
        tag: release