-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflatpakbits.sh
executable file
·68 lines (58 loc) · 1.71 KB
/
flatpakbits.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
# updates the `strongbox-flatpak` repo, runs `makepkg` within a container.
# called after releasing Strongbox on Github.
set -eux
release="$1" # "1.2.3"
export GIT_PAGER=cat
GITHUB_TOKEN=$(cat .github-token)
export GITHUB_TOKEN
test -f parse-changelog
test -f gh
test -d strongbox
locate --regex 'xmllint$'
locate --regex 'jq$'
locate --regex 'python3$'
if [ -d strongbox-flatpak ]; then
(
cd strongbox-flatpak
git reset --hard
git checkout master
git pull
)
else
git clone ssh://[email protected]/ogri-la/strongbox-flatpak
fi
# update the list of releases in the metainfo.xml
python3 generate-metainfo.py "$release" | xmllint --format - > strongbox-flatpak/metainfo.xml
# update the checksums of the flathub description
python3 generate-flathub.py "$release" > strongbox-flatpak/la.ogri.strongbox.yml
# build the flatpak
(
cd strongbox-flatpak
git update-index -q --refresh # even touching a tracked file report it as changed unless index is updated
if git diff-index --quiet HEAD; then
echo "no changes to commit"
else
#./build-flatpak.sh
git add metainfo.xml la.ogri.strongbox.yml
git commit -am "metainfo.xml, la.ogri.strongbox.yml, updated"
git push
git tag "$release"
git push --tags
fi
)
# open a PR on Flathub
rm -rf la.ogri.strongbox
git clone ssh://[email protected]/flathub/la.ogri.strongbox
(
cd la.ogri.strongbox
git checkout -b "$release"
cp ../strongbox-flatpak/la.ogri.strongbox.yml .
git commit -am "$release"
git push --set-upstream origin "$release"
../gh pr create \
--base "master" \
--head "$release" \
--body "" \
--title "$release"
)