Skip to content

Commit

Permalink
Compress and upload XZ files (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrarimarco authored Sep 25, 2021
1 parent 74e8f4d commit 5707395
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/build-os-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,9 @@ jobs:
- uses: actions/upload-artifact@v2
with:
if-no-files-found: error
name: ${{ env.CUSTOMIZED_IMAGE_FILE_NAME }}
name: ${{ env.CUSTOMIZED_COMPRESSED_IMAGE_FILE_NAME }}
path: |
${{ env.TEMP_WORKSPACE_PATH }}/**/*.img
${{ env.TEMP_WORKSPACE_PATH }}/**/*.iso
${{ env.TEMP_WORKSPACE_PATH }}/**/*.xz
strategy:
matrix:
build-configuration-file-path:
Expand Down Expand Up @@ -98,6 +97,5 @@ jobs:
strategy:
matrix:
artifact-file-extension:
- img
- iso
- xz
...
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,16 @@ mv -v "${IMAGE_FILE_PATH}" "${TARGET_IMAGE_FILE_PATH}"
BUILD_RESULTS_FILE_PATH="${IMAGE_FILE_DIRECTORY_PATH}"/results.out

echo "CUSTOMIZED_IMAGE_FILE_NAME=${TARGET_IMAGE_FILE_NAME}" >>"${BUILD_RESULTS_FILE_PATH}"

ARCHIVE_FILE_EXTENSION=".xz"
echo "Removing image archive (extension: ${ARCHIVE_FILE_EXTENSION}) path leftovers..."
rm -f ./*"${ARCHIVE_FILE_EXTENSION}"

echo "Compressing ${TARGET_IMAGE_FILE_PATH}..."
xz -9 \
--compress \
--threads=0 \
--verbose \
"${TARGET_IMAGE_FILE_PATH}"

echo "CUSTOMIZED_COMPRESSED_IMAGE_FILE_NAME=${TARGET_IMAGE_FILE_NAME}${ARCHIVE_FILE_EXTENSION}" >>"${BUILD_RESULTS_FILE_PATH}"

0 comments on commit 5707395

Please sign in to comment.