Skip to content

Commit

Permalink
Update release.sh
Browse files Browse the repository at this point in the history
- Uploades source archive instead of downloading tag from GitHub
  • Loading branch information
nimaaskarian committed Mar 31, 2024
1 parent 4c0c218 commit bc59743
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LAST_TAG=$(git tag | tail -n 1)
PACKAGE_NAME=c3
USERNAME=nimaaskarian
TAG="$1"
MD5=""

push_tag() {
git tag "$TAG" || {
Expand All @@ -19,18 +20,18 @@ push_tag() {
release_package() {
cp target/release/c3 c3.x86.linux || echo_exit copy linux binary failed
cp target/x86_64-pc-windows-gnu/release/c3.exe c3.x86_64.windows.exe || echo_exit copy windows binary failed
FILES="c3.x86.linux c3.x86_64.windows.exe"
SOURCE=source.tar.gz
git archive --output=$SOURCE --prefix=c3-$TAG/ $TAG -9
MD5=$(md5sum $SOURCE | cut -f 1 -d ' ')
FILES="c3.x86.linux c3.x86_64.windows.exe $SOURCE"
gh release create "$TAG" $FILES --title "$TAG" --notes "**Full Changelog**: https://github.com/$USERNAME/$PACKAGE_NAME/compare/$LAST_TAG...$TAG" --repo $USERNAME/$PACKAGE_NAME
rm $FILES
}

release_c3() {
cd aur || echo_exit cd to aur directory failed.
sed -i "s/pkgver=$LAST_TAG/pkgver=$TAG/" c3/PKGBUILD
wget "https://github.com/$USERNAME/$PACKAGE_NAME/archive/refs/tags/$TAG.zip"
MD5=$(md5sum $TAG.zip | cut -f 1 -d ' ')
sed -i "s/md5sums=('.*')/md5sums=('$MD5')/" c3/PKGBUILD
rm $TAG.zip

cd c3 || echo_exit cd to c3 failed
makepkg --printsrcinfo > .SRCINFO
Expand Down

0 comments on commit bc59743

Please sign in to comment.