-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathcreate_bundle.sh
More file actions
38 lines (30 loc) · 1.21 KB
/
create_bundle.sh
File metadata and controls
38 lines (30 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Check if a version argument is provided
if [ -z "$1" ]; then
echo "Usage: $0 <version>"
exit 1
fi
# First, you do need to run './gradlew publish' to generate the artifacts.
# I can't publish via API, but I can create a bundle for manual upload.
VERSION=$1
# Use this script as a stop gap for manual uploading
mkdir -p io/github/andrewquijano/ciphercraft/$VERSION
cp build/libs/* io/github/andrewquijano/ciphercraft/$VERSION/
cp build/publications/mavenJava/pom-default.xml io/github/andrewquijano/ciphercraft/$VERSION/ciphercraft-$VERSION.pom
cp build/publications/mavenJava/pom-default.xml.asc io/github/andrewquijano/ciphercraft/$VERSION/ciphercraft-$VERSION.pom.asc
# Loop through all files in the specified directory
for file in io/github/andrewquijano/ciphercraft/$VERSION/*; do
# Print the file being checked
echo "Processing file: $file"
# Skip files ending with .asc
if [[ -f "$file" && ! "$file" =~ \.asc$ ]]; then
echo "Generating hashes for: $file"
# Generate SHA1 checksum
sha1sum "$file" | awk '{print $1}' > "${file}.sha1"
# Generate MD5 checksum
md5sum "$file" | awk '{print $1}' > "${file}.md5"
else
echo "Skipping file: $file"
fi
done
zip -r bundle.zip io/