-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeb
executable file
·76 lines (60 loc) · 1.95 KB
/
deb
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#optional: 1 ppa sufix
if [ -z "${dist}" ]; then
zipfile=last.zip
else
zipfile=last${dist:0:1}.zip
fi
if [ -z "${ppa}" ]; then
ppa=ppa
else
ppa=${ppa}
fi
#with ssh-ppa , in /etc/dput.cf there is ssh-ppa section , at login use colin-i instead of *
#and ssh key at launchpad, and store ~/.ssh/id_rsa , id_rsa.pub
dest=ssh-ppa
target=${dest}:colin-i/${ppa}${1}
echo ${target}
if [ ! -e "../${zipfile}" ]; then
#gh cli is also on the hosted runner, can get artifact there too
id=$(gh run list --workflow=deb.yml -b $(git rev-parse --abbrev-ref HEAD) | cut -f7 | head -1)
repo_at_gh=`cat debian/control | grep "^Homepage" | grep -o [^/]*$`
url=`gh api -H "Accept: application/vnd.github.v3+json" /repos/colin-i/${repo_at_gh}/actions/runs/${id}/artifacts | jq ".artifacts[0].archive_download_url"`
#pat
#default login <USERNAME> password <PERSONAL ACCESS TOKEN>
url=${url:1:-1}
curl -H "Authorization: token `cat ~/n/pat`" -L -o ../${zipfile} ${url}
#not ok on kinetic curl --netrc-file ~/n/pat2 -L -o ../${zipfile} ${url}
#L is for redirects
fi
cd ../tmp
array=(`ls`)
get_prog_ver () {
array=(`ls`)
#if was in runner:
#echo parola | gpg --batch --yes --passphrase-fd 0 --import gpg.gpg
files=
for var in "${array[@]}"
do
files+=" ${var}"
#a=`echo -n $var | grep -o [^.]*.[^.]*.[^.]*$`
#if [ "$a" != "debian.tar.xz" ]; then
# mv ${var} ${var}2
# cat ~/n/gpg | gpg --pinentry-mode loopback --passphrase-fd 0 \
# --local-user D51F0B6365EAB122 --clearsign --output ${var} ${var}2
# rm ${var}2
#fi
#Checksum doesn't match for /home...
done
prog_ver=`echo ${array[0]} | grep -Po ".*(?=.deb)" `
}
if [ -z "${array}" ]; then
unzip ../${zipfile}
get_prog_ver
#the key not here, fresh reboot
cat ~/n/gpg | xclip -selection clipboard
debsign -k D51F0B6365EAB122 ${prog_ver}_source.changes
else
get_prog_ver
fi
dput -f ${target} ${prog_ver}_source.changes && \
rm ${files} && rm ../${zipfile} && rm ${prog_ver}_source.${dest}.upload