diff --git a/release.sh b/release.sh index e0caacf..ec40168 100755 --- a/release.sh +++ b/release.sh @@ -6,6 +6,7 @@ LAST_TAG=$(git tag | tail -n 1) PACKAGE_NAME=c3 USERNAME=nimaaskarian TAG="$1" +MD5="" push_tag() { git tag "$TAG" || { @@ -19,7 +20,10 @@ 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 } @@ -27,10 +31,7 @@ release_package() { 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