Skip to content

Commit

Permalink
create PR for add-ok
Browse files Browse the repository at this point in the history
  • Loading branch information
hboutemy committed Sep 29, 2024
1 parent 871a7fa commit e1ef534
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 11 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/update-reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,33 @@ jobs:
git commit -m "nightly update of content"
git push
- name: Add PRs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for line in `cat tmp/add-ok.txt`
do
echo "$line"
previousBuildspec="$(echo $line | cut -d ':' -f 1)"
nextVersion="$(echo $line | cut -d ':' -f 2)"
. ${previousBuildspec}
dir=`dirname ${previousBuildspec}`
file=`basename ${previousBuildspec} -${version}.buildspec`
nextBuildspec=${dir}/${file}-${nextVersion}.buildspec
if [ $(git ls-remote -h https://github.com/jvm-repo-rebuild/reproducible-central.git | grep refs/heads/$artifactId-$nextVersion | wc -l) -eq 1 ]
then
echo "skipping because branch $artifactId-$nextVersion exists"
else
bin/add-new-release.sh $previousBuildspec $nextVersion
git checkout -b $artifactId-$nextVersion
git add ${nextBuildspec}
git commit -m "add ${artifactId} ${nextVersion}" -m "" -m "https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/${dir}/README.md"
git push --set-upstream origin $artifactId-$nextVersion
gh pr create --fill --head $artifactId-$nextVersion
git switch master
fi
done
24 changes: 14 additions & 10 deletions bin/add-new-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,17 @@ else
[ -n "$jarArtifactId" ] && echo -e "\033[0;31m $nextJar not found\033[0;0m"
fi
echo -e "test local build with: \033[0;32m./rebuild.sh ${nextBuildspec} $3\033[0m"
echo
echo -e "once buildspec is ok:"
echo -e "1. either create a PR:"
echo -e "\033[0;32mgit checkout -b $artifactId-$nextVersion ; git add ${nextBuildspec} ; git commit -m 'add ${artifactId} ${nextVersion}' -m '' -m 'https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/${dir}/README.md' ; git push --set-upstream origin $artifactId-$nextVersion ; gh pr create --fill --head $artifactId-$nextVersion\033[0m"
echo -e "2. or commit directly to master:"
echo -e "\033[0;32mbin/update-project-summary.sh ${dir} ; git add ${dir} ; git commit -m \"add ${artifactId} ${nextVersion}\" ; git push\033[0m"
echo -e "3. or drop the local test:"
echo -e "\033[0;32mrm ${dir}/*-${nextVersion}\.*\033[0m"
if [ "$CI" = true ]
then
echo -e "\033[0;32m${nextBuildspec}\033[0m"
else
echo -e "test local build with: \033[0;32m./rebuild.sh ${nextBuildspec} $3\033[0m"
echo
echo -e "once buildspec is ok:"
echo -e "1. either create a PR:"
echo -e "\033[0;32mgit checkout -b $artifactId-$nextVersion ; git add ${nextBuildspec} ; git commit -m 'add ${artifactId} ${nextVersion}' -m '' -m 'https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/${dir}/README.md' ; git push --set-upstream origin $artifactId-$nextVersion ; gh pr create --fill --head $artifactId-$nextVersion\033[0m"
echo -e "2. or commit directly to master:"
echo -e "\033[0;32mbin/update-project-summary.sh ${dir} ; git add ${dir} ; git commit -m \"add ${artifactId} ${nextVersion}\" ; git push\033[0m"
echo -e "3. or drop the local test:"
echo -e "\033[0;32mrm ${dir}/*-${nextVersion}\.*\033[0m"
fi
5 changes: 4 additions & 1 deletion bin/update-reproducibility-summary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ do
done | sort -k 2 | while read -r p ; do echo "${p##* }/${p% *}/maven-metadata.xml"; done > maven-metadata
count="$(wc -l maven-metadata | cut -d ' ' -f 1)"

\rm -f "tmp/add-ok.txt"

for metadata in `cat maven-metadata`
do
((countGa++))
Expand Down Expand Up @@ -92,6 +94,7 @@ do
rebuildOk="ok" && [ $ko -gt 0 ] && rebuildOk="ko"
echo "| <!-- ${lastUpdated} --> [${artifactId}](../${dir}/README.md) | [${previousVersion}](../$dir/${previousBuildspec}) $rebuildStatus" \
"| [${addVersion}](../$addBuildspec) | \`bin/add-new-release.sh $dir/${previousBuildspec} ${addVersion}\` |" >> tmp/add-${rebuildOk}.md
echo "$dir/${previousBuildspec}:${addVersion}" >> tmp/add-${rebuildOk}.txt
else
# no release already exists, list it if it was not reproducible: it requires rework to prepare next release
if [ ! -f "${dir}/${previousBuildcompare}" ] || [ $ko -ne 0 ]
Expand Down Expand Up @@ -213,7 +216,7 @@ sed -e "/$lead/,/$tail/{ /$lead/{p; r tmp/add-ok-table.md
}; /$tail_newest/p; d }" >> tmp/add.md
cp tmp/add.md doc/add.md

\rm -rf tmp
[ "$1" == "update" ] || \rm -rf tmp

if grep "unexpected issue" README.md; then
echo "Uh oh, found 'unexpected issue' in README.md."
Expand Down

0 comments on commit e1ef534

Please sign in to comment.