Skip to content

Commit

Permalink
chore: update checksum file naming convention (#2)
Browse files Browse the repository at this point in the history
* chore: update checksum file naming

* fix: hardcode path to ISO directory

* chore: standardise output naming

* fix: update checksum path
  • Loading branch information
p5 authored Dec 23, 2024
1 parent df06d26 commit 78c6e19
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ Currently only ISOs are supported, but contributions are welcome.
| Name | Description | Example |
| - | - | - |
| `output-directory` | Directory containing all output artifacts | `./outputs/buildiso` |
| `output-file` | Path to the build file | `./outputs/buildiso/install.iso` |
| `output-path` | Path to the build file | `./outputs/buildiso/install.iso` |
| `checksum-path` | Path to the checksum file | `./outputs/buildiso/CHECKSUM` |
| `checksum` | Checksum of the build file | `sha256:...` |
13 changes: 7 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ outputs:
output-directory:
description: 'Directory containing the built image'
value: ${{ steps.set-outputs.outputs.output_directory }}
output-file:
output-path:
description: 'Path to the built image'
value: ${{ steps.set-outputs.outputs.path }}
checksum-path:
Expand Down Expand Up @@ -79,18 +79,19 @@ runs:
--chown $DESIRED_UID:$DESIRED_GID \
$IMAGE
# Create a checksum of the output file, stored in the same directory
CHECKSUM=$(sha256sum ./output/bootiso/*.iso | awk '{print $1}')
echo $CHECKSUM > ./output/bootiso/CHECKSUM
ISO_PATH=$(ls ./output/bootiso/*.iso)
ISO_PATH=$(ls $OUTPUT_DIRECTORY/bootiso/*.iso)
# Create a checksum of the output file, stored in the same directory
CHECKSUM=$(sha256sum $ISO_PATH | awk '{print $1}')
CHECKSUM_PATH=${ISO_PATH}-CHECKSUM
echo $CHECKSUM > ${CHECKSUM_PATH}
# Get the parent directory of the ISO
OUTPUT_DIRECTORY=$(dirname $ISO_PATH)
echo "OUTPUT_DIRECTORY=$OUTPUT_DIRECTORY" >> $GITHUB_OUTPUT
echo "CHECKSUM=$CHECKSUM" >> $GITHUB_OUTPUT
echo "CHECKSUM_PATH=$OUTPUT_DIRECTORY/CHECKSUM" >> $GITHUB_OUTPUT
echo "CHECKSUM_PATH=$CHECKSUM_PATH" >> $GITHUB_OUTPUT
echo "ISO_PATH=$ISO_PATH" >> $GITHUB_OUTPUT
- name: Set Outputs
Expand Down

0 comments on commit 78c6e19

Please sign in to comment.