diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index ce6761d..bb8b3b7 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -108,9 +108,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ env.ISO_NAME }}.iso - path: | - ${{ steps.build.outputs.iso-path }} - ${{ steps.build.outputs.checksum-path }} + path: ${{ steps.build.outputs.output-directory }} if-no-files-found: error retention-days: 0 compression-level: 0 @@ -226,4 +224,3 @@ jobs: ./${check} fi done - diff --git a/README.md b/README.md index 2dff8a7..ca9968a 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,7 @@ This action is designed to be called from a GitHub workflow using the following uses: actions/upload-artifact@v4 with: name: my_iso.iso - path: | - ${{ steps.build.outputs.iso_path }} - ${{ steps.build.outputs.checksum-path }} + path: ${{ steps.build.outputs.output-directory }} if-no-files-found: error retention-days: 0 compression-level: 0 @@ -52,10 +50,11 @@ Available options for VARIANT can be found by running `dnf provides system-relea Variant will be the third item in the package name. Example: `fedora-release-kinoite-39-34.noarch` will be kinoite ### Outputs -| Variable | Description | Usage | -| ----------------- | -------------------------------------------------------- | ------------------------------------------------ | -| iso-path | Path to ISO file that the action creates | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso_path }} | -| checksum-path | Path to the checksum file that the action creates | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso_path }} | +| Variable | Description | Usage | +| ----------------- | ------------------------------------------------------ | -------------------------------------------------------- | +| output-directory | Path to all files in the output directory | ${{ steps.YOUR_ID_FOR_ACTION.outputs.output-directory }} | +| iso-path | Path to just the ISO file that the action creates | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso-path }} | +| checksum-path | Path to just the checksum file that the action creates | ${{ steps.YOUR_ID_FOR_ACTION.outputs.checksum-path }} | For outputs, see example above. @@ -129,4 +128,3 @@ Build a new container image: "privileged": true } ``` - diff --git a/action.yml b/action.yml index 392d809..679df88 100644 --- a/action.yml +++ b/action.yml @@ -48,6 +48,9 @@ inputs: required: false outputs: + output-directory: + value: ${{ steps.run_docker.outputs.OUTPUT_DIRECTORY }} + description: The location of all output objects iso-path: value: ${{ steps.run_docker.outputs.ISO_PATH }} description: The location of the .iso object @@ -80,8 +83,9 @@ runs: - name: Rename ISO file shell: bash run: | - mv ${{ github.workspace }}/deploy.iso ${{ github.workspace }}/${{ inputs.iso_name }}.iso - cd ${{ github.workspace }} + mv ${{ github.workspace }}/build/deploy.iso ${{ github.workspace }}/build/${{ inputs.iso_name }}.iso + cd ${{ github.workspace }}/build sha256sum ${{ inputs.iso_name }}.iso > ${{ inputs.iso_name }}-CHECKSUM - echo "ISO_PATH=$(realpath ${{ github.workspace }}/${{ inputs.iso_name }}.iso)" >> $GITHUB_OUTPUT - echo "CHECKSUM_PATH=$(realpath ${{ github.workspace }}/${{ inputs.iso_name }}-CHECKSUM)" >> $GITHUB_OUTPUT + echo "OUTPUT_DIRECTORY=$(realpath ${{ github.workspace }}/build/)" >> $GITHUB_OUTPUT + echo "ISO_PATH=$(realpath ${{ github.workspace }}/build/${{ inputs.iso_name }}.iso)" >> $GITHUB_OUTPUT + echo "CHECKSUM_PATH=$(realpath ${{ github.workspace }}/build/${{ inputs.iso_name }}-CHECKSUM)" >> $GITHUB_OUTPUT diff --git a/entrypoint.sh b/entrypoint.sh index 55618b8..256c600 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -16,5 +16,9 @@ make boot.iso $@ # Add container to ISO make build/deploy.iso $@ +# Make output dir in github workspace +mkdir /github/workspace/build || true + +# Copy resulting iso to githubworkspace and fix permissions cp build/deploy.iso /github/workspace/build -chmod -R ugo=rwx /github/workspace/build \ No newline at end of file +chmod -R ugo=rwx /github/workspace/build