|
39 | 39 | The artifact can also contain any additional files which will be applied as overrides to the checkout root before building, |
40 | 40 | for example icons in the `build/` directory to override the app icons. |
41 | 41 | default: "webapp" |
| 42 | + test: |
| 43 | + type: boolean |
| 44 | + required: false |
| 45 | + default: true |
| 46 | + description: "Whether to run the test stage after building" |
| 47 | + test-args: |
| 48 | + type: string |
| 49 | + required: false |
| 50 | + description: "Additional arguments to pass to playwright" |
| 51 | + runs-on: |
| 52 | + type: string |
| 53 | + required: false |
| 54 | + description: "The runner image to use, normally set for you, may be needed for running in private repos." |
| 55 | + artifact-prefix: |
| 56 | + type: string |
| 57 | + required: false |
| 58 | + description: "An optional prefix to add to the artifact name, useful for distinguishing builds in private repos." |
| 59 | + default: "" |
| 60 | + targets: |
| 61 | + type: string |
| 62 | + required: false |
| 63 | + description: "List of targets to build" |
| 64 | + default: "tar.gz deb" |
42 | 65 | env: |
43 | 66 | SQLCIPHER_BUNDLED: ${{ inputs.sqlcipher == 'static' && '1' || '' }} |
44 | 67 | MAX_GLIBC: 2.31 # bullseye-era glibc, used by glibc-check.sh |
45 | 68 | permissions: {} # No permissions required |
46 | 69 | jobs: |
47 | 70 | build: |
| 71 | + name: Build Linux ${{ inputs.arch }} SQLCipher ${{ inputs.sqlcipher }} |
48 | 72 | # We build on native infrastructure as matrix-seshat fails to cross-compile properly |
49 | 73 | # https://github.com/matrix-org/seshat/issues/135 |
50 | | - runs-on: ${{ inputs.arch == 'arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04' }} |
| 74 | + runs-on: ${{ inputs.runs-on || (inputs.arch == 'arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04') }} |
51 | 75 | env: |
52 | 76 | HAK_DOCKER_IMAGE: ghcr.io/element-hq/element-desktop-dockerbuild |
53 | 77 | steps: |
@@ -109,7 +133,7 @@ jobs: |
109 | 133 |
|
110 | 134 | - name: "Get modified files" |
111 | 135 | id: changed_files |
112 | | - if: steps.cache.outputs.cache-hit != 'true' && github.event_name == 'pull_request' |
| 136 | + if: steps.cache.outputs.cache-hit != 'true' && github.event_name == 'pull_request' && github.repository == 'element-hq/element-desktop' |
113 | 137 | uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46 |
114 | 138 | with: |
115 | 139 | files: | |
@@ -159,13 +183,11 @@ jobs: |
159 | 183 | echo "USE_SYSTEM_FPM=true" >> $GITHUB_ENV |
160 | 184 |
|
161 | 185 | - name: Build App |
162 | | - run: yarn build --publish never -l ${{ steps.config.outputs.build-args }} |
| 186 | + run: yarn build --publish never ${{ steps.config.outputs.build-args }} -l ${{ inputs.targets }} |
163 | 187 | env: |
164 | 188 | VARIANT_PATH: variant.json |
165 | 189 | # Only set for Nightly builds |
166 | 190 | VERSION: ${{ inputs.version }} |
167 | | - FPM_DEBUG: true # TODO |
168 | | - DEBUG: electron-builder # TODO |
169 | 191 | # Workaround for https://github.com/electron-userland/electron-builder/issues/5721 |
170 | 192 | USE_HARD_LINKS: false |
171 | 193 |
|
@@ -199,39 +221,46 @@ jobs: |
199 | 221 | - name: Upload Artifacts |
200 | 222 | uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 |
201 | 223 | with: |
202 | | - name: linux-${{ inputs.arch }}-sqlcipher-${{ inputs.sqlcipher }} |
| 224 | + name: ${{ inputs.artifact-prefix }}linux-${{ inputs.arch }}-sqlcipher-${{ inputs.sqlcipher }} |
203 | 225 | path: | |
204 | 226 | dist |
205 | 227 | !dist/*-unpacked/** |
206 | 228 | retention-days: 1 |
207 | 229 |
|
208 | | - - name: Assert all required files are present |
| 230 | + - name: Assert deb is present and valid |
| 231 | + if: contains(inputs.targets, 'deb') |
209 | 232 | run: | |
210 | 233 | test -f ./dist/element-desktop*$ARCH.deb |
211 | | - test -f ./dist/element-desktop*.tar.gz |
| 234 | +
|
| 235 | + DEB_LISTING=$(dpkg-deb --fsys-tarfile ./dist/element-desktop*.deb | tar -tv) |
| 236 | + echo "deb listing: " |
| 237 | + echo "$DEB_LISTING" |
| 238 | + ! echo "$DEB_LISTING" | grep '^h' |
212 | 239 | env: |
213 | 240 | ARCH: ${{ inputs.arch }} |
214 | 241 |
|
215 | | - - name: Assert no hardlinks are found |
| 242 | + - name: Assert tar.gz is present |
| 243 | + if: contains(inputs.targets, 'tar.gz') |
216 | 244 | run: | |
| 245 | + test -f ./dist/element-desktop*.tar.gz |
| 246 | +
|
217 | 247 | TAR_GZ_LISTING=$(tar -tvf ./dist/element-desktop*.tar.gz) |
218 | 248 | echo "tar.gz listing: " |
219 | 249 | echo "$TAR_GZ_LISTING" |
220 | 250 | ! echo "$TAR_GZ_LISTING" | grep '^h' |
221 | 251 |
|
222 | | - DEB_LISTING=$(dpkg-deb --fsys-tarfile ./dist/element-desktop*.deb | tar -tv) |
223 | | - echo "deb listing: " |
224 | | - echo "$DEB_LISTING" |
225 | | - ! echo "$DEB_LISTING" | grep '^h' |
226 | | -
|
227 | 252 | test: |
| 253 | + name: Test Linux ${{ inputs.arch }} SQLCipher ${{ inputs.sqlcipher }} |
228 | 254 | needs: build |
| 255 | + if: inputs.test && contains(inputs.targets, 'deb') |
229 | 256 | uses: ./.github/workflows/build_test.yaml |
230 | 257 | with: |
231 | | - artifact: linux-${{ inputs.arch }}-sqlcipher-${{ inputs.sqlcipher }} |
232 | | - runs-on: ${{ inputs.arch == 'arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04' }} |
| 258 | + project: linux-${{ inputs.arch }}-sqlcipher-${{ inputs.sqlcipher }} |
| 259 | + artifact: ${{ inputs.artifact-prefix }}linux-${{ inputs.arch }}-sqlcipher-${{ inputs.sqlcipher }} |
| 260 | + runs-on: ${{ inputs.runs-on || (inputs.arch == 'arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04') }} |
233 | 261 | executable: /opt/Element*/element-desktop* |
234 | 262 | prepare_cmd: | |
235 | 263 | sudo apt-get -qq update |
236 | 264 | sudo apt install ./dist/*.deb |
237 | 265 | blob_report: ${{ inputs.blob_report }} |
| 266 | + args: ${{ inputs.test-args }} |
0 commit comments