Skip to content

Commit 0f0ebfb

Browse files
committed
ci: More fixes around sudo
Signed-off-by: Tyler Erickson <[email protected]>
1 parent 2410fba commit 0f0ebfb

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

.github/workflows/meson.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -322,28 +322,39 @@ jobs:
322322
shell: bash
323323

324324
- name: Set ownership of executables to root:root
325-
if: ${{ matrix.config.os != 'windows-latest' }} && matrix.config.image == ''
326-
run: sudo chown -R root:root build
327-
328-
- name: Set ownership of executables to root:root (container)
329-
if: ${{ matrix.config.os != 'windows-latest' }} && matrix.config.image != ''
330-
run: chown -R root:root build
325+
if: ${{ matrix.config.os != 'windows-latest' }}
326+
run: |
327+
if [[ -z "${{ matrix.config.image }}" ]]; then
328+
sudo chown -R root:root build
329+
else
330+
chown -R root:root build
331+
fi
331332
332333
- name: Packing release
333334
env:
334335
ARCHIVE_EXT: ${{ matrix.config.release_extension }}
335336
run: |
336337
cd build
337338
if [[ "${{ matrix.config.os }}" != "windows-latest" ]]; then
338-
sudo ${{ matrix.config.archive_command }} "${DESTDIR}${ARCHIVE_EXT}" $DESTDIR
339+
if [[ -z "${{ matrix.config.image }}" ]]; then
340+
sudo ${{ matrix.config.archive_command }} "${DESTDIR}${ARCHIVE_EXT}" $DESTDIR
341+
else
342+
${{ matrix.config.archive_command }} "${DESTDIR}${ARCHIVE_EXT}" $DESTDIR
343+
fi
339344
else
340345
${{ matrix.config.archive_command }} "${DESTDIR}${ARCHIVE_EXT}" $DESTDIR
341346
fi
342347
shell: bash
343348

344349
- name: Set ownership of tar archive to root:root
345350
if: ${{ matrix.config.os != 'windows-latest' }}
346-
run: sudo chown root:root build/"${DESTDIR}${ARCHIVE_EXT}"
351+
run: |
352+
if [[ -z "${{ matrix.config.image }}" ]]; then
353+
sudo chown root:root build/"${DESTDIR}${ARCHIVE_EXT}"
354+
else
355+
chown root:root build/"${DESTDIR}${ARCHIVE_EXT}"
356+
fi
357+
347358
348359
- name: Generate Hashes
349360
if: ${{ matrix.config.publish_release }}

0 commit comments

Comments
 (0)