Skip to content

Commit

Permalink
Apply fixes for appimage builds
Browse files Browse the repository at this point in the history
Updated version of old download action. Fixed license file
inclusion in build with proper placement and arguments.
  • Loading branch information
chrisroberts committed Oct 30, 2024
1 parent e533753 commit d29b80c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
14 changes: 11 additions & 3 deletions .ci/build-appimage-in-chroot
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ root="$( cd -P "$( dirname "$csource" )/../" && pwd )"

gem_dir="${1?Directory of gem file required}"
license_file="${2?License file is required}"
substrate_dir="${2?Directory of substrate file required}"
output_dir="${3?Directory for output file required}"
substrate_dir="${3?Directory of substrate file required}"
output_dir="${4?Directory for output file required}"

if [ ! -d "${gem_dir}" ]; then
failure "Invalid path provided for gem directory (%s)" \
Expand Down Expand Up @@ -131,9 +131,17 @@ debug "copying substrate %s -> %s" "${substrate_file}" "${chroot_substrate_path}
cp "${substrate_file}" "${chroot_substrate_path}" ||
failure "Could not copy substrate into chroot"

# Copy in the license
chroot_license="LICENSE.txt"
chroot_license_path="${chroot_dir}/${chroot_license}"
# Add the license into the chroot
debug "copying gem %s -> %s" "${license_file}" "${chroot_license_path}"
cp "${license_file}" "${chroot_license_path}" ||
failure "Could not copy license into chroot"

debug "running vagrant appimage build"
chroot "${chroot_dir}" "${project_name}/package/build-appimage" "/${chroot_substrate}" \
"/${chroot_gem}" "/${chroot_output}" ||
"/${chroot_gem}" /"${chroot_license}" "/${chroot_output}" ||
failure "Failed to install vagrant gem into substrate"

debug "install build is complete, moving artifacts - %s -> %s" \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
name: ${{ inputs.vagrant-gem-name }}
path: ${{ inputs.vagrant-gem-path }}
- name: Fetch Licenses
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: ${{ inputs.vagrant-licenses-name }}
path: ${{ inputs.vagrant-licenses-path }}
Expand Down
2 changes: 1 addition & 1 deletion package/build-appimage
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ root="$( cd -P "$( dirname "$csource" )/../" && pwd )"

# Verify arguments
if [ "$#" -ne "4" ]; then
failure "Expected three args: SUBSTRATE-FILE GEM-FILE LICENSE-FILE OUTPUT-DIR"
failure "Expected four args: SUBSTRATE-FILE GEM-FILE LICENSE-FILE OUTPUT-DIR"
fi

substrate_file="${1?Substrate file is required}"
Expand Down

0 comments on commit d29b80c

Please sign in to comment.