forked from MetaCoq/metacoq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake-opam-files.sh
executable file
·52 lines (39 loc) · 1006 Bytes
/
make-opam-files.sh
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
42
43
44
45
46
47
48
49
50
51
52
#/usr/bin/env bash
if (($# < 4))
then
echo "Usage: make-opam-files.sh ../opam/released/packages <version> <tag> <package-url>"
exit 0
fi
archive=`basename $4`
tag=$3
echo "Target directory: " $1
echo "Target version: " $2
echo "Releases package: " $4
echo "Archive:" $archive
echo "Tag:" $tag
if [ -f $archive ]
then
echo "Removing existing archive!"
rm $archive
fi
wget $4
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
skipline=""
for f in *.opam;
do
opamf=${f/.opam/};
target=$1/$opamf/$opamf.$2/opam;
echo $opamf;
mkdir -p $1/$opamf/$opamf.$2
skipline="$skipline $opamf.$2"
gsed -e "/^version:.*/d" $f > $target
echo url { >> $target
echo " src:" \"$release\" >> $target
echo " checksum:" \"sha512=$hash\" >> $target
echo } >> $target
done
echo "ci-skip:" $skipline