-
Notifications
You must be signed in to change notification settings - Fork 68
110 lines (106 loc) · 2.53 KB
/
release.yaml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Release
on:
push:
tags:
- 'v*'
env:
GO_VERSION: stable
jobs:
build_for_linux:
name: Build for Linux
runs-on: ubuntu-latest
steps:
- name: Install build dependencies
run: |
sudo apt-get -qq update
sudo apt-get install -y --no-install-recommends \
build-essential
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Build amd64
env:
CGO_ENABLED: 1
GOOS: linux
GOARCH: amd64
run: make release
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: dist-linux
path: sqls-linux-*.zip
build_for_macos:
name: Build for MacOS
runs-on: macos-latest
steps:
- name: Install build dependencies
run: brew install coreutils
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Build amd64
env:
CGO_ENABLED: 1
GOOS: darwin
GOARCH: amd64
run: make release
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: dist-darwin
path: sqls-darwin-*.zip
build_for_windows:
name: Build for Windows
runs-on: windows-latest
steps:
- name: Install build dependencies
run: choco install zip
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Build amd64
shell: bash
env:
CGO_ENABLED: 1
GOOS: windows
GOARCH: amd64
run: make release
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: dist-windows
path: sqls-windows-*.zip
release:
name: Draft Release
needs:
- build_for_linux
- build_for_macos
- build_for_windows
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: sqls ${{ github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
generate_release_notes: true
files: dist-*/sqls*.*