Skip to content

Commit

Permalink
Update make_opam_files to upload the archive to the releases folder o…
Browse files Browse the repository at this point in the history
…n github to avoid issues with github rebuilding the tarballs
  • Loading branch information
mattam82 committed Mar 19, 2024
1 parent 9af0b0f commit f55eb7c
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions make-opam-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,33 @@ then
exit 0
fi

archive=`basename $3`
tag=${archive/.tar.gz/}

echo "Target directory: " $1
echo "Target version: " $2
echo "Releases package: " $3
echo "Archive:" $archive
echo "Tag:" $tag

if [ -f $archive ]
then
echo "Removing existing archive!"
rm $archive
fi

wget $3
archive=`basename $3`

hash=`shasum -a 512 $archive | cut -f 1 -d " "`

echo "Shasum = " $hash

echo "Uploading to release assets"

gh release upload $tag $archive

release=https://github.com/MetaCoq/metacoq/releases/download/$tag/$archive

for f in *.opam;
do
opamf=${f/.opam/};
Expand All @@ -24,7 +41,7 @@ do
mkdir -p $1/$opamf/$opamf.$2
gsed -e "/^version:.*/d" $f > $target
echo url { >> $target
echo " src:" \"$3\" >> $target
echo " src:" \"$release\" >> $target
echo " checksum:" \"sha512=$hash\" >> $target
echo } >> $target
done

0 comments on commit f55eb7c

Please sign in to comment.