forked from bytebase/bytebase
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-artifacts-and-draft-release.yml
More file actions
115 lines (113 loc) · 3.41 KB
/
build-artifacts-and-draft-release.yml
File metadata and controls
115 lines (113 loc) · 3.41 KB
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
name: Build release artifacts and draft release
on:
push:
tags:
- "*.*.*"
jobs:
build-linux-binary:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
with:
version: 8.6.0
- uses: actions/setup-node@v3
with:
node-version: "18"
cache: pnpm
cache-dependency-path: "frontend/pnpm-lock.yaml"
- run: pnpm install --frozen-lockfile
working-directory: frontend
- run: pnpm release
working-directory: frontend
- uses: actions/setup-go@v4
with:
go-version: 1.21.0
- name: Build
uses: goreleaser/goreleaser-action@v4
with:
args: release --skip-publish --config scripts/.goreleaser-for-linux.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload
uses: actions/upload-artifact@v3
with:
name: bytebase-linux
path: dist/bytebase*
build-darwin-binary:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
with:
version: 8.6.0
- uses: actions/setup-node@v3
with:
node-version: "18"
cache: pnpm
cache-dependency-path: "frontend/pnpm-lock.yaml"
- run: pnpm install --frozen-lockfile
working-directory: frontend
- run: pnpm release
working-directory: frontend
- uses: actions/setup-go@v4
with:
go-version: 1.21.0
- name: Build
uses: goreleaser/goreleaser-action@v4
with:
args: release --skip-publish --config scripts/.goreleaser-for-darwin.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload
uses: actions/upload-artifact@v3
with:
name: bytebase-darwin
path: dist/bytebase*
draft-release:
needs: [build-linux-binary, build-darwin-binary]
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
with:
version: 8.6.0
- uses: actions/setup-node@v3
with:
node-version: "18"
cache: pnpm
cache-dependency-path: "frontend/pnpm-lock.yaml"
- run: pnpm install --frozen-lockfile
working-directory: frontend
- run: pnpm release
working-directory: frontend
- uses: actions/setup-go@v4
with:
go-version: 1.21.0
- name: Make directories
run: |
mkdir -p ./bytebase-build/linux
mkdir -p ./bytebase-build/darwin
- name: Download linux binaries
uses: actions/download-artifact@v3
with:
name: bytebase-linux
path: ./bytebase-build/linux
- name: Download darwin binaries
uses: actions/download-artifact@v3
with:
name: bytebase-darwin
path: ./bytebase-build/darwin
- name: Merge checksum file
run: |
cd ./bytebase-build
cat ./darwin/bytebase*checksums.txt >> checksums.txt
cat ./linux/bytebase*checksums.txt >> checksums.txt
rm ./darwin/bytebase*checksums.txt
rm ./linux/bytebase*checksums.txt
- name: Release
uses: goreleaser/goreleaser-action@v4
with:
args: release --config scripts/.goreleaser-release.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}