add nisse 0.4.5 #3491
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
pull_request_target: | |
branches: [ "master" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Checkout PR | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh pr checkout ${{ github.event.pull_request.number }} | |
git config --local user.email "[email protected]" | |
git config --local user.name "Reproducible Central CI" | |
git config --local advice.detachedHead false | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Log into ghcr.io registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: List buildspecs | |
run: | | |
for file in $(git diff --name-only -r HEAD^1 HEAD); do | |
if [[ $file == *.buildspec ]]; then | |
display="" | |
. $file | |
[ -n "$display" ] || display="$groupId:$artifactId" | |
echo "- \`$file\` [$display](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/$(dirname $file)/README.md)" >> PRcomment.txt | |
fi | |
done | |
- name: Init PR comment with buildspecs | |
if: ${{ hashFiles('PRcomment.txt') != '' }} | |
uses: mshick/add-pr-comment@v2 | |
with: | |
message-path: | | |
PRcomment.txt | |
- name: Build from buildspec | |
run: | | |
[ -f PRcomment.txt ] && rm PRcomment.txt | |
for file in $(git diff --name-only -r HEAD^1 HEAD); do | |
if [[ $file == *.buildspec ]]; then | |
display="" | |
. $file | |
[ -n "$display" ] || display="$groupId:$artifactId" | |
echo "- [$display](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/$(dirname $file)/README.md) $version" >> PRcomment.txt | |
echo >> PRcomment.txt | |
echo "\`./rebuild.sh $file\`" >> PRcomment.txt | |
if [[ "$command" == SHELL* ]] | |
then | |
# don't even try to automatically build, but prepare message for PR comment | |
echo "command=$command" | |
echo "ko=1 | |
Configured build command requires interactive shell: | |
\`\`\` | |
command=$command | |
\`\`\` | |
Run | |
\`\`\` | |
git switch $artifactId-$version | |
./rebuild.sh $file | |
( ... interactive shell ... ) | |
bin/update-project-summary.sh $(dirname $file) | |
git add $(dirname $file) | |
git commit -m './rebuild.sh $file' | |
git push | |
gh pr merge -m | |
\`\`\`" >> PRcomment.txt | |
cat PRcomment.txt | |
continue | |
fi | |
sudo apt-get -qq install -y dos2unix 2>&1 > /dev/null | |
./rebuild.sh $file | |
bin/update-project-summary.sh "$(dirname $file)" | |
git add "$(dirname $file)" | |
git commit -m "./rebuild.sh $file" | |
git push | |
buildcompare="$(dirname $file)/$(basename $buildinfo .buildinfo).buildcompare" | |
echo '```' >> PRcomment.txt | |
grep -v okFiles "$buildcompare" >> PRcomment.txt | |
echo '```' >> PRcomment.txt | |
if [ $(grep "ko=0" PRcomment.txt | wc -l) -eq 0 ] | |
then | |
./build_diffoscope.sh "$buildcompare" buildcache/$artifactId | |
diffoscope="$(dirname $file)/$(basename $buildinfo .buildinfo).diffoscope" | |
[ -f $diffoscope ] && mv "$diffoscope" . \ | |
&& echo ":mag: diffoscope analysis uploaded to ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> PRcomment.txt | |
fi | |
echo '```' >> PRcomment.txt | |
cat time.txt >> PRcomment.txt | |
echo '```' >> PRcomment.txt | |
rm -f time.txt | |
fi | |
done | |
- name: Add PR comment with results | |
if: ${{ hashFiles('PRcomment.txt') != '' }} | |
uses: mshick/add-pr-comment@v2 | |
with: | |
message-path: | | |
PRcomment.txt | |
- name: Merge PR | |
if: ${{ hashFiles('PRcomment.txt') != '' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
if [ $(grep "^ko=" PRcomment.txt | grep -v "ko=0" | wc -l) -eq 0 ] | |
then | |
if [ "${{ github.event.pull_request.user.login }}" = "hboutemy" ] | |
then | |
gh pr merge -m -d | |
fi | |
fi | |
- name: Archive diffoscope output | |
if: ${{ hashFiles('*.diffoscope') != '' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: diffoscope | |
path: "*.diffoscope" |