add eforms-core-java 1.7.0 #9149
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 "reproducible-central@github.io" | |
| git config --local user.name "Reproducible Central CI" | |
| git config --local advice.detachedHead false | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3.0.0 | |
| - name: Set up Go toolchain | |
| uses: actions/setup-go@v5.5.0 | |
| with: | |
| go-version: 1.22.5 | |
| - name: Log into ghcr.io registry | |
| uses: docker/login-action@v3.0.0 | |
| 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 | |
| echo '```' >> PRcomment.txt | |
| cat $file >> PRcomment.txt | |
| echo '```' >> 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="" | |
| PR_merge_max_ko="0" | |
| . $file | |
| [ -n "$display" ] || display="$groupId:$artifactId" | |
| badge="/badge.json)" | |
| echo "- [$display $badge](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/$(dirname $file)/README.md) $version" >> PRcomment.txt | |
| echo >> PRcomment.txt | |
| if [[ "$command" == SHELL* ]] | |
| then | |
| echo "\`./rebuild.sh $file\`" >> PRcomment.txt | |
| # 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 # end of SHELL* | |
| echo "<details><summary>./rebuild.sh $file</summary>" >> PRcomment.txt | |
| echo >> PRcomment.txt | |
| echo '```' >> PRcomment.txt | |
| cat $file >> PRcomment.txt | |
| echo '```' >> PRcomment.txt | |
| echo >> PRcomment.txt | |
| echo "</details>" >> PRcomment.txt | |
| echo >> PRcomment.txt | |
| sudo apt-get -qq install -y dos2unix 2>&1 > /dev/null | |
| ./rebuild.sh $file | |
| # update metadata if version not there | |
| metadata="$(dirname ${file})/maven-metadata.xml" | |
| grep "version>${version}</version" ${metadata} || curl -s --fail https://repo.maven.apache.org/maven2/$(echo ${groupId} | tr '.' '/')/${artifactId}/maven-metadata.xml --output ${metadata} | |
| git add ${metadata} | |
| 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 | |
| ko="$(grep "^ko=" PRcomment.txt | cut -d = -f 2)" | |
| echo "PR_merge_max_ko=$PR_merge_max_ko: ko=$ko" | |
| if [ $ko -ne 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 | |
| echo '<details><summary>run time</summary>' >> PRcomment.txt | |
| echo >> PRcomment.txt | |
| echo '```' >> PRcomment.txt | |
| cat time.txt >> PRcomment.txt | |
| echo '```' >> PRcomment.txt | |
| if [ "$ko" -le "$PR_merge_max_ko" ] | |
| then | |
| echo "=> merge PR" >> PRcomment.txt | |
| fi | |
| echo >> PRcomment.txt | |
| echo "</details>" >> 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 "^=> merge PR" PRcomment.txt | wc -l) -eq 1 ] | |
| 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" |