-
Notifications
You must be signed in to change notification settings - Fork 1
161 lines (126 loc) · 3.81 KB
/
release.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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Build & Release
on:
workflow_dispatch:
env:
GOPRIVATE: "github.com/dbnet-io/*,github.com/slingdata-io/*"
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
SSH_SERVER_URL: ${{ secrets.SSH_SERVER_URL }}
RUDDERSTACK_URL: ${{ secrets.RUDDERSTACK_URL }}
jobs:
build-frontend:
timeout-minutes: 15
# runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
- name: Set up Node 16
uses: actions/setup-node@v1
with:
node-version: '16.x'
- name: Cache NPM
id: cache-npm
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Build frontend
run: |
npm install -g yarn
bash scripts/build.frontend.sh
- uses: actions/upload-artifact@v2
with:
name: webapp-dist
path: server/app
release-brew:
timeout-minutes: 20
runs-on: [self-hosted, macOS, ARM64]
# runs-on: macos-latest
needs: [build-frontend]
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
- uses: actions/download-artifact@v2
with:
name: webapp-dist
path: server/app
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --clean --skip-validate -f .goreleaser.mac.yaml
release-linux:
runs-on: ubuntu-20.04
# runs-on: [self-hosted, Linux]
timeout-minutes: 20
needs: [build-frontend]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
- uses: actions/download-artifact@v2
with:
name: webapp-dist
path: server/app
- name: Login docker
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "$DOCKER_PASSWORD" | docker login -u dbnetio --password-stdin
- name: Configure git for private modules
run: git config --global url."https://flarco:${GITHUB_TOKEN}@github.com".insteadOf "https://github.com"
- name: Run GoReleaser
# uses: flarco/goreleaser-action@master
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --clean --skip-validate -f .goreleaser.linux.yaml
release-windows:
runs-on: windows-latest
# runs-on: [self-hosted, Windows]
timeout-minutes: 20
needs: [build-frontend]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
- uses: actions/download-artifact@v2
with:
name: webapp-dist
path: server/app
- name: Configure git for private modules
run: git config --global url."https://flarco:$env:[email protected]".insteadOf "https://github.com"
- name: Run GoReleaser
# uses: flarco/goreleaser-action@master
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --clean --skip-validate -f .goreleaser.windows.yaml
deploy-staging:
timeout-minutes: 5
runs-on: self-hosted
needs: [release-linux]
steps:
- uses: actions/checkout@v2
- name: Deploy to Staging
run: bash scripts/deploy.staging.sh