-
Notifications
You must be signed in to change notification settings - Fork 26
237 lines (205 loc) · 7.38 KB
/
build_and_deploy.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
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
---
name: Build And Deploy
on:
push:
branches:
- "**"
jobs:
dagger_build:
name: Dagger Build and Test
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- name: Set keys
run: |
echo "${{secrets.QUILL_SIGN_P12}}" | base64 -d > ./cert.p12
echo "${{secrets.QUILL_NOTORY_KEY}}" > ./key.p8
echo "QUILL_SIGN_PASSWORD=${{secrets.QUILL_SIGN_PASSWORD}}" >> $GITHUB_ENV
echo "GITHUB_TOKEN=${{secrets.GH_TOKEN}}" >> $GITHUB_ENV
- name: All
uses: dagger/dagger-for-github@v5
with:
verb: call
module: ./.dagger
args: all --output=./output --src=. --github-token=GITHUB_TOKEN --notorize-cert=./cert.p12 --notorize-cert-password=QUILL_SIGN_PASSWORD --notorize-key=./key.p8 --notorize-id=${{secrets.QUILL_NOTARY_KEY_ID}} --notorize-issuer=${{secrets.QUILL_NOTARY_ISSUER}}
version: "0.9.9"
cloud-token: ${{ secrets.DAGGER_TOKEN }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: archives
path: |
./output
- name: Send status to Discord
uses: sarisia/actions-status-discord@v1
if: always()
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
tile: ${{ github.job_id }}
description: "Build application"
functional_test_docker:
name: Test Docker
runs-on: ubuntu-latest
needs: dagger_build
strategy:
max-parallel: 2
fail-fast: false
matrix:
folder: [
'./examples/container',
'./examples/build',
'./examples/docs',
'./examples/nomad',
'./examples/single_k3s_cluster',
'./examples/multiple_k3s_clusters',
'./examples/exec',
'./examples/certificates',
'./examples/terraform',
'./examples/registries',
]
steps:
- name: Download-Binaries
uses: actions/download-artifact@v2
with:
name: archives
path: ./build_artifacts
- name: Install binary executable
run: |
cp $(find ./build_artifacts -name "jumppad_*_linux_x86_64.tar.gz" -type f) ./build_artifacts/jumppad.tar.gz
sudo tar -xzf ./build_artifacts/jumppad.tar.gz
sudo mv ./jumppad /usr/local/bin/jumppad
sudo chmod +x /usr/local/bin/jumppad
- uses: actions/checkout@v2
- name: Run tests
run: |
jumppad check --non-interactive
jumppad purge --non-interactive
jumppad test --non-interactive ${{matrix.folder}}
- name: Send status to Discord
uses: sarisia/actions-status-discord@v1
if: always()
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
tile: ${{ github.job_id }}
description: "Functional tests for docker: ${{matrix.folder}}"
functional_test_podman:
name: Test Podman
runs-on: ubuntu-latest
needs: dagger_build
strategy:
max-parallel: 2
fail-fast: false
matrix:
folder: [
'./examples/container',
'./examples/build',
'./examples/docs',
'./examples/nomad',
'./examples/single_k3s_cluster',
'./examples/multiple_k3s_clusters',
'./examples/exec',
]
steps:
- name: Download-Binaries
uses: actions/download-artifact@v2
with:
name: archives
path: ./build_artifacts
- name: Install binary executable
run: |
cp $(find ./build_artifacts -name "jumppad_*_linux_x86_64.tar.gz" -type f) ./build_artifacts/jumppad.tar.gz
sudo tar -xzf ./build_artifacts/jumppad.tar.gz
sudo mv ./jumppad /usr/local/bin/jumppad
sudo chmod +x /usr/local/bin/jumppad
- uses: actions/checkout@v2
- name: Install dependencies for Podman tests
run: |
sudo mkdir -p /etc/apt/keyrings
# Debian Unstable/Sid
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/Debian_Unstable/Release.key \
| gpg --dearmor \
| sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\
https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/Debian_Unstable/ /" \
| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null
# Install Podman
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install podman
# Start the Podman sock
sudo nohup podman system service -t 0 > ./podman.log &
sleep 10
sudo chmod +x /run/podman
sudo chmod 777 /run/podman/podman.sock
- name: Run tests
run: |
jumppad check --non-interactive
jumppad purge --non-interactive
jumppad test --non-interactive ${{matrix.folder}}
env:
DOCKER_HOST: "unix:///run/podman/podman.sock"
- name: Send status to Discord
uses: sarisia/actions-status-discord@v1
if: always()
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
tile: ${{ github.job_id }}
description: "Functional tests for ${{matrix.folder}}"
release:
name: Create GitHub Release
if: ${{ github.ref == 'refs/heads/main' }}
needs:
- functional_test_docker
- functional_test_podman
environment:
name: release
runs-on: ubuntu-latest
steps:
- name: Set keys
run: |
echo "GITHUB_TOKEN=${{secrets.GH_TOKEN}}" >> $GITHUB_ENV
echo "GEMFURY_TOKEN=${{secrets.FURY_TOKEN}}" >> $GITHUB_ENV
- uses: actions/checkout@v2
- name: Download-Binaries
uses: actions/download-artifact@v2
with:
name: archives
path: ./build_artifacts
- name: Release
uses: dagger/dagger-for-github@v5
with:
verb: call
module: ./.dagger
args: release --src=. --github-token=GITHUB_TOKEN --gemfury-token=GEMFURY_TOKEN --archives=./build_artifacts --output=./version.txt
version: "0.9.9"
cloud-token: ${{ secrets.DAGGER_TOKEN }}
- name: Set output
id: setoutput
run: |
echo "version=$(cat ./version.txt)" >> $GITHUB_OUTPUT
outputs:
version: ${{ steps.setoutput.outputs.version }}
winget:
name: Publish to WinGet
needs:
- release
runs-on: windows-latest
steps:
- uses: jumppad-labs/[email protected]
with:
publish-type: "Update"
user: "jumppad"
package: "jumppad"
version: ${{ needs.release.outputs.version }}
url: "https://github.com/jumppad-labs/jumppad/releases/download/${{ needs.release.outputs.version }}/jumppad_${{ needs.release.outputs.version }}_windows_x86_64.zip|x64"
token: '${{ secrets.GH_TOKEN }}'
- name: Send status to Discord
uses: sarisia/actions-status-discord@v1
if: always()
with:
tile: ${{ github.job_id }}
webhook: ${{ secrets.DISCORD_WEBHOOK }}
description: "Push new version ${{ needs.github_release.outputs.version }} to Winget"