-
-
Notifications
You must be signed in to change notification settings - Fork 45
175 lines (150 loc) · 5.2 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
name: 'Stump Nightly CI'
on:
pull_request:
branches:
- develop
- main
push:
branches:
- develop
# TODO: should I push nightly on main pushes? then on tag, an actual tagged release?
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
jobs:
docker-build:
name: Build docker image
runs-on: [self-hosted]
steps:
- name: Checkout repository
uses: actions/checkout@v3
# FIXME: vars.SUPPORTED_PR_DOCKER_PLATFORMS and vars.SUPPORTED_DOCKER_PLATFORMS
# suddenly doesn't work anymore??? super annoying...
# On PRs, we will only load the image into docker for the quickest platform
# (i.e. linux/amd64). This is mostly a smoke test, just rather ignorant verification
# that the image can be built. On pushes, we will actually build and push for
# all supported platforms.
- name: Configure environment
run: |
echo "LOAD=${{ github.event_name == 'pull_request' }}" >> $GITHUB_ENV
echo "PUSH=${{ github.event_name == 'push' }}" >> $GITHUB_ENV
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
echo "PLATFORMS=linux/amd64" >> $GITHUB_ENV
else
echo "PLATFORMS=linux/arm64/v8,linux/amd64" >> $GITHUB_ENV
fi
- name: Setup and build docker image
uses: ./.github/actions/build-docker
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
tags: 'nightly'
load: ${{ env.LOAD }}
push: ${{ env.PUSH }}
platforms: ${{ env.PLATFORMS }}
discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}
# TODO: build executables for apple(x86_64,darwin?),linux(x86_64,arm64?), and windows(x86_64)
# These should be uploaded to the nightly release as artifacts. Old artifacts should be deleted
# before uploading new ones.
build-web:
name: Bundle web app
runs-on: [self-hosted]
if: false # TODO: don't do that
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build web
uses: ./.github/actions/build-web
- name: Upload web build
uses: ./.github/actions/upload-artifact
with:
upload-name: webapp
upload-path: apps/web/dist
build-linux-server:
name: Compile server app (self-hosted linux)
needs: build-web
runs-on: [self-hosted]
if: false # TODO: don't do that
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build server
uses: ./.github/actions/build-server
with:
platform: 'linux'
- name: Upload stump server
uses: ./.github/actions/upload-artifact
with:
upload-name: stump_server-linux
upload-path: target/release/stump_server
build-server:
strategy:
fail-fast: true
matrix:
platform: [macos, windows]
name: Compile server app
needs: build-web
runs-on: ${{ matrix.platform }}
if: false # TODO: don't do that
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build server
uses: ./.github/actions/build-server
with:
platform: ${{ matrix.platform }}
- name: Upload stump server
uses: ./.github/actions/upload-artifact
with:
upload-name: stump_server-${{ matrix.platform }}
upload-path: target/release/stump_server
# build-linux-desktop:
# name: Compile desktop app (self-hosted linux)
# needs: build-web
# runs-on: [self-hosted]
# if: false # TODO: don't do that
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# - name: Build desktop
# uses: ./.github/actions/build-desktop
# with:
# platform: 'linux'
# - name: Upload desktop
# uses: ./.github/actions/upload-artifact
# with:
# upload-name: stump-desktop-linux
# upload-path: target/release/bundle
build-desktop:
strategy:
fail-fast: true
matrix:
platform: [macos, windows]
name: Compile desktop app
needs: build-web
runs-on: ${{ matrix.platform }}
if: false # TODO: don't do that
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build desktop
uses: ./.github/actions/build-desktop
with:
platform: ${{ matrix.platform }}
# https://github.com/tauri-apps/tauri-action
# - uses: tauri-apps/tauri-action@v0
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# tagName: stump-desktop-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
# releaseName: 'Stump Desktop v__VERSION__'
# releaseBody: 'See the assets to download this version and install.'
# releaseDraft: true
# prerelease: true
# - name: Upload desktop
# uses: ./.github/actions/upload-artifact
# with:
# upload-name: stump-desktop-${{ matrix.platform }}
# upload-path: target/release/bundle