Skip to content

Commit

Permalink
.github(cross-compile, upload-archive): rename to archive (#795)
Browse files Browse the repository at this point in the history
"archive" is more descriptive than "artifact", and matches the new name
of the upload-archive script.
  • Loading branch information
ee7 authored Aug 16, 2023
1 parent 2bbe981 commit 7f2611a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions .github/bin/cross-compile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -eo pipefail

artifacts_dir='artifacts'
archives_dir='archives'
build_tag="${GITHUB_REF_NAME}"

cross_compile() {
Expand All @@ -21,9 +21,9 @@ cross_compile() {
echo "stripping large comment section from executable..." >&2
llvm-strip -R .comment "${binary_name}"
fi
mkdir -p "${artifacts_dir}"
local artifact_file="${artifacts_dir}/${binary_name}_${build_tag}_${os}_${arch}.tar.gz"
tar -cvzf "${artifact_file}" "${binary_name}"
mkdir -p "${archives_dir}"
local archive="${archives_dir}/${binary_name}_${build_tag}_${os}_${arch}.tar.gz"
tar -cvzf "${archive}" "${binary_name}"
}

main() {
Expand All @@ -39,7 +39,7 @@ main() {
cross_compile "${target}"
done

gh release upload "${build_tag}" "${artifacts_dir}"/*
gh release upload "${build_tag}" "${archives_dir}"/*
}

main
14 changes: 7 additions & 7 deletions .github/bin/upload-archive
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#!/usr/bin/env sh

artifacts_dir='artifacts'
mkdir -p "${artifacts_dir}"
archives_dir='archives'
mkdir -p "${archives_dir}"

binary_name='configlet'
build_tag="${GITHUB_REF_NAME}"

case "${OS}" in
windows)
artifact_file="${artifacts_dir}/${binary_name}_${build_tag}_${OS}_${ARCH}.zip"
7z a "${artifact_file}" "${binary_name}.exe"
archive="${archives_dir}/${binary_name}_${build_tag}_${OS}_${ARCH}.zip"
7z a "${archive}" "${binary_name}.exe"
;;
linux | macos)
artifact_file="${artifacts_dir}/${binary_name}_${build_tag}_${OS}_${ARCH}.tar.gz"
tar -cvzf "${artifact_file}" "${binary_name}"
archive="${archives_dir}/${binary_name}_${build_tag}_${OS}_${ARCH}.tar.gz"
tar -cvzf "${archive}" "${binary_name}"
;;
esac

gh release upload "${build_tag}" "${artifact_file}"
gh release upload "${build_tag}" "${archive}"

0 comments on commit 7f2611a

Please sign in to comment.