-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·41 lines (32 loc) · 812 Bytes
/
release.sh
File metadata and controls
executable file
·41 lines (32 loc) · 812 Bytes
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
39
40
41
#!/bin/bash
set -e
# Usage check
if [ $# -ne 2 ]; then
echo "Usage: $0 <version> <directory>"
exit 1
fi
VERSION="$1"
DIR="$2"
TAG="v$VERSION"
TITLE="$(date +%Y-%m-%d), Version $VERSION"
# Find files in the specified directory
FILES=("$DIR"/"$VERSION"*)
if [ ${#FILES[@]} -eq 0 ]; then
echo "No files found in $DIR starting with $VERSION"
exit 1
fi
echo "Files to upload: ${FILES[@]}"
# Create release with GitHub CLI
gh release create "$TAG" "${FILES[@]}" \
--title "$TITLE" \
--notes "" \
--draft=false \
--prerelease=false
echo "Release $TAG created successfully!"
# Append version to released.txt
echo "$VERSION" >> released.txt
# Commit and push the update
git add released.txt
git commit -m "[Automated] Updated released.txt"
git push
echo "released.txt updated and changes pushed."