-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
179 lines (145 loc) · 4.54 KB
/
nightly.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: Release Nightly
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
inputs:
tag_name:
description: 'Tag name for release'
required: false
default: nightly
push:
tags: ['v[0-9]+.[0-9]+.[0-9]+*']
pull_request:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
tagname:
runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.tag.outputs.tag }}
steps:
- if: github.event_name == 'workflow_dispatch'
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
- if: github.event_name == 'schedule'
run: echo 'TAG_NAME=nightly' >> $GITHUB_ENV
- if: github.event_name == 'push'
run: |
TAG_NAME=${{ github.ref }}
echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV
- if: github.event_name == 'pull_request'
run: echo 'TAG_NAME=debug' >> $GITHUB_ENV
- id: vars
shell: bash
run: echo "sha_short=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
- if: env.TAG_NAME == 'nightly'
run: echo 'TAG_NAME=nightly-${{ steps.vars.outputs.sha_short }}' >> $GITHUB_ENV
- id: tag
run: echo "tag=$TAG_NAME" >> $GITHUB_OUTPUT
windows:
runs-on: windows-latest
needs: tagname
env:
RELEASE_TAG_NAME: ${{ needs.tagname.outputs.tag_name }}
steps:
- uses: actions/checkout@v4
- name: Fetch dependencies
run: npm i
- name: Build packages
run: |
npm run build:graphql-docs
npm run build:bruno-query
npm run build:bruno-common
- name: Build app
run: |
npm run build:electron -- win
ls ./packages/bruno-electron/out/
- uses: actions/upload-artifact@v4
with:
name: build-windows
path: |
./packages/bruno-electron/out/bruno_*
retention-days: 1
linux:
runs-on: ubuntu-latest
container: node:20.11
needs: tagname
env:
RELEASE_TAG_NAME: ${{ needs.tagname.outputs.tag_name }}
DEBIAN_FRONTEND: noninteractive
steps:
- uses: actions/checkout@v4
- name: Fetch dependencies
run: npm i
- name: Build packages
run: |
npm run build:graphql-docs
npm run build:bruno-query
npm run build:bruno-common
- name: Build app
run: |
npm run build:electron -- linux
npm run build:electron -- deb
- uses: actions/upload-artifact@v4
with:
name: build-linux
path: |
./packages/bruno-electron/out/bruno_*
retention-days: 1
macos:
runs-on: macos-latest
needs: tagname
env:
RELEASE_TAG_NAME: ${{ needs.tagname.outputs.tag_name }}
steps:
- uses: actions/checkout@v4
- name: Fetch dependencies
run: |
npm i
- name: Build packages
run: |
npm run build:graphql-docs
npm run build:bruno-query
npm run build:bruno-common
- name: Build app
run: |
npm run build:electron -- mac
- uses: actions/upload-artifact@v4
with:
name: build-macos
path: |
./packages/bruno-electron/out/bruno_*
retention-days: 1
if-no-files-found: error
publish:
if: github.event_name != 'pull_request'
needs: [linux, windows, macos]
runs-on: ubuntu-latest
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
# Must perform checkout first, since it deletes the target directory
# before running, and would therefore delete the downloaded artifacts
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- if: github.event_name == 'workflow_dispatch'
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
- if: github.event_name == 'schedule'
run: echo 'TAG_NAME=nightly' >> $GITHUB_ENV
- if: github.event_name == 'push'
run: |
TAG_NAME=${{ github.ref }}
echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV
- run: |
(echo 'SUBJECT=Bruno development build';
echo 'PRERELEASE=--prerelease') >> $GITHUB_ENV
gh release delete nightly --yes || true
git push origin :nightly || true
- name: Publish release
env:
DEBUG: api
run: |
gh release create $TAG_NAME $PRERELEASE --title "$TAG_NAME" --target $GITHUB_SHA build-linux/* build-windows/* build-macos/*