Skip to content

Commit

Permalink
Publish archive files in tar.gz format (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
superbrothers authored Feb 27, 2020
1 parent 18b695a commit b9ae531
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ deploy:
file:
- "out/*.zip"
- "out/*.zip.sha256"
- "out/*.tar.gz"
- "out/*.tar.gz.sha256"
- "out/sort-manifests.yaml"
skip_cleanup: true
on:
Expand Down
32 changes: 19 additions & 13 deletions hack/make-archives.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,27 @@ if [[ ! -d "${bin_dir}" ]]; then
exit 1
fi

# Create archive files in zip and tar.gz format for each arch
for osarch in $(ls "$bin_dir"); do
archive_file="out/ksort-${osarch}.zip"
echo "Creating ${archive_file}" >&2
( \
cd "${bin_dir}/${osarch}/" && \
cp ../../../LICENSE.txt . && \
cp ../../../README.md . && \
zip -r "../../../${archive_file}" * \
)
for format in zip tar.gz; do
archive_file="out/ksort-${osarch}.${format}"
echo "Creating ${archive_file}" >&2
( \
cd "${bin_dir}/${osarch}/" && \
cp ../../../LICENSE.txt . && \
cp ../../../README.md . && \
[[ "$format" == "zip" ]] && \
zip -r "../../../${archive_file}" * \
|| \
tar zcvf "../../../${archive_file}" * \
)

tar_sumfile="${archive_file}.sha256"
tar_checksum="$(shasum -a 256 "$archive_file" | awk '{print $1}')"
echo "${archive_file}: checksum: ${tar_checksum}" >&2
echo "$tar_checksum" >"${tar_sumfile}"
echo "Written ${tar_sumfile}"
archive_sumfile="${archive_file}.sha256"
archive_checksum="$(shasum -a 256 "$archive_file" | awk '{print $1}')"
echo "${archive_file}: checksum: ${archive_checksum}" >&2
echo "$archive_checksum" >"${archive_sumfile}"
echo "Written ${archive_sumfile}"
done
done

# Copy and process ksort manifest
Expand Down

0 comments on commit b9ae531

Please sign in to comment.