-
Notifications
You must be signed in to change notification settings - Fork 2.5k
133 lines (130 loc) · 4.58 KB
/
Copy pathbuild.yaml
File metadata and controls
133 lines (130 loc) · 4.58 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
'env':
'BASE_IMAGE': |-
${{ vars.BASE_IMAGE || 'adguard/go-builder:1.26.8--1' }}
'BUILD_DIR': |-
build
'CLIENT_DIR': |-
${{ inputs.client_dir || 'client_v2' }}
'DIST_DIR': |-
dist
'FRONTEND_BASE_IMAGE': |-
${{ vars.FRONTEND_BASE_IMAGE || 'adguard/home-js-builder:4.0' }}
'jobs':
'Build':
'if': |
${{ github.repository_owner == 'AdGuardSoftwareLimited' }}
'permissions':
'contents': 'read'
'runs-on': 'team-go'
'steps':
- 'uses': 'actions/checkout@v6'
'with':
# Set to false to avoid GITHUB_TOKEN leaking.
#
# See https://github.com/actions/checkout/issues/485#issuecomment-934422611.
'persist-credentials': false
- 'name': 'Build frontend'
'uses': 'AdGuardSoftwareLimited/actions/actions/docker-build@master'
'with':
'dockerfile': 'docker/frontend.Dockerfile'
'context': '.'
'target': 'builder-exporter'
'output': '.'
'build-args': |
BASE_IMAGE=${{ env.FRONTEND_BASE_IMAGE }}
CACHE_BUSTER=${{ inputs.cache_buster || '0' }}
CLIENT_DIR=${{ env.CLIENT_DIR }}
DIST_DIR=${{ env.BUILD_DIR }}
- 'uses': 'actions/upload-artifact@v7'
'with':
'name': 'adguardhomefrontend'
'path': |
${{ env.BUILD_DIR }}
- 'name': 'Set source date epoch'
'run': |
echo "SOURCE_DATE_EPOCH=$(git log -1 --format=%ct)" >> "$GITHUB_ENV"
- 'name': 'Build QA artifacts'
'uses': 'AdGuardSoftwareLimited/actions/actions/docker-build@master'
'with':
'dockerfile': 'docker/ci.Dockerfile'
'context': '.'
'target': 'builder-exporter'
'output': '.'
'build-args': |
ARCH=amd64 arm64
BASE_IMAGE=${{ env.BASE_IMAGE }}
BRANCH=${{ github.ref_name }}
CACHE_BUSTER=${{ inputs.cache_buster || '0' }}
CHANNEL=development
DIST_DIR=${{ env.DIST_DIR }}
OS=windows darwin linux
REVISION=${{ github.sha }}
SIGN=0
SOURCE_DATE_EPOCH=${{ env.SOURCE_DATE_EPOCH }}
VERSION=${{ github.ref_name }}
- 'uses': 'actions/upload-artifact@v7'
'with':
'name': 'adguardhome'
'path': |
${{ env.DIST_DIR }}/AdGuardHome_windows_amd64.zip
${{ env.DIST_DIR }}/AdGuardHome_darwin_amd64.zip
${{ env.DIST_DIR }}/AdGuardHome_darwin_arm64.zip
${{ env.DIST_DIR }}/AdGuardHome_linux_amd64.tar.gz
'TestE2E':
'if': |
${{ github.repository_owner == 'AdGuardSoftwareLimited' }}
'needs': 'Build'
'permissions':
'contents': 'read'
'runs-on': 'team-go'
'steps':
- 'uses': 'actions/checkout@v6'
'with':
# Set to false to avoid GITHUB_TOKEN leaking.
#
# See https://github.com/actions/checkout/issues/485#issuecomment-934422611.
'persist-credentials': false
- 'uses': 'actions/download-artifact@v8'
'with':
'name': 'adguardhomefrontend'
'path': |
${{ env.BUILD_DIR }}
- 'uses': 'actions/download-artifact@v8'
'with':
'name': 'adguardhome'
'path': |
${{ env.DIST_DIR }}
- 'run': |
#!/bin/sh
set -e -f -u -x
tar -xzf ${{ env.DIST_DIR }}/AdGuardHome_linux_amd64.tar.gz -C /tmp
mv /tmp/AdGuardHome/AdGuardHome ./AdGuardHome
- 'name': 'Run tests'
'uses': 'AdGuardSoftwareLimited/actions/actions/docker-build@master'
'with':
'dockerfile': 'docker/frontend.Dockerfile'
'context': '.'
'target': 'e2etester'
# No output: exporting the e2etester filesystem hangs the build.
'build-args': |
BASE_IMAGE=${{ env.FRONTEND_BASE_IMAGE }}
CACHE_BUSTER=${{ inputs.cache_buster || '0' }}
CLIENT_DIR=${{ env.CLIENT_DIR }}
'name': 'Build and Test QA Artifacts'
'on':
'push':
'branches':
- '*'
'workflow_dispatch':
'inputs':
'cache_buster':
'default': ''
'description': |
Override to force re-run of cached stages (pass any unique value).
'type': 'string'
# Permissions are disabled for all the jobs by default, and then overridden for
# specific jobs if needed. This is a recommended practice for security reasons,
# and also allows to avoid mistakes with permissions when creating new jobs.
#
# See https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#permissions.
'permissions': {}