Skip to content

Commit

Permalink
fix(build): fix mv of image file (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
KwadFan authored Mar 12, 2023
1 parent b7acb1e commit dc8c588
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/BuildImages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,53 +54,53 @@ jobs:
with:
config: ${{ matrix.config }}

- name: Copy output
id: copy-image
- name: Rename image file
id: move-image
if: always()
shell: bash
run: |
source repository/src/config
NOW="$(date +"%Y-%m-%d")"
IMAGE="${NOW}-${DIST_NAME}-${DIST_VERSION}-${{ steps.build.outputs.type }}-${{ steps.build.outputs.sbc }}"
mv repository/src/workspace/*.img $IMAGE.img
sudo mv repository/src/workspace/*.img $IMAGE.img
echo "image=${IMAGE}" >> $GITHUB_OUTPUT
- name: Upload failed Logfile
if: failure()
uses: actions/upload-artifact@v3
with:
name: failed-${{ steps.copy-image.outputs.image }}.log
name: failed-${{ steps.move-image.outputs.image }}.log
path: repository/src/build.log

- name: Compressing Image
shell: bash
run: |
CPU_COUNT="$(nproc)"
echo -e "\e[32mUsing ${CPU_COUNT} Cores for compression...\e[0m"
xz -efkvz9T"${CPU_COUNT}" ${{ steps.copy-image.outputs.image }}.img
xz -efkvz9T"${CPU_COUNT}" ${{ steps.move-image.outputs.image }}.img
- name: Calculating checksums
shell: bash
run: |
sha256sum ${{ steps.copy-image.outputs.image }}.img > ${{ steps.copy-image.outputs.image }}.img.sha256
sha256sum ${{ steps.copy-image.outputs.image }}.img.xz > ${{ steps.copy-image.outputs.image }}.img.xz.sha256
sha256sum ${{ steps.move-image.outputs.image }}.img > ${{ steps.move-image.outputs.image }}.img.sha256
sha256sum ${{ steps.move-image.outputs.image }}.img.xz > ${{ steps.move-image.outputs.image }}.img.xz.sha256
- name: Upload Compressed Image
uses: actions/upload-artifact@v3
with:
name: ${{ steps.copy-image.outputs.image }}.img.xz
path: ${{ steps.copy-image.outputs.image }}.img.xz
name: ${{ steps.move-image.outputs.image }}.img.xz
path: ${{ steps.move-image.outputs.image }}.img.xz

- name: Upload Compressed Image Checksum
uses: actions/upload-artifact@v3
with:
name: ${{ steps.copy-image.outputs.image }}.img.xz.sha256
path: ${{ steps.copy-image.outputs.image }}.img.xz.sha256
name: ${{ steps.move-image.outputs.image }}.img.xz.sha256
path: ${{ steps.move-image.outputs.image }}.img.xz.sha256

- name: Upload Image Checksum
uses: actions/upload-artifact@v3
with:
name: ${{ steps.copy-image.outputs.image }}.img.sha256
path: ${{ steps.copy-image.outputs.image }}.img.sha256
name: ${{ steps.move-image.outputs.image }}.img.sha256
path: ${{ steps.move-image.outputs.image }}.img.sha256

0 comments on commit dc8c588

Please sign in to comment.