Skip to content

Commit 53849ca

Browse files
committed
Better handle reruns on same commit, add debug output for building JOSM with mvn
Signed-off-by: Taylor Smock <smocktaylor@gmail.com>
1 parent 16382a5 commit 53849ca

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

.github/workflows/ant.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,13 @@ jobs:
102102
# Count the total commits for this branch
103103
run: |
104104
revision="v$(($(git rev-list --count HEAD) + ${{ inputs.revision-offset }}))"
105-
git tag $revision
106-
git push -u origin $revision
105+
if [ $(git tag | grep '^'"$revision"'$' | wc -l) -eq 0 ]; then
106+
git tag $revision
107+
git push -u origin $revision
108+
elif [ $(git diff ${{ github.sha }}..$revision --name-only | wc -l) -ne 0 ]; then
109+
echo "Already existing tag pointing to different revision"
110+
exit 1
111+
fi
107112
echo "revision=$revision" >> $GITHUB_OUTPUT
108113
109114
plugin-build:
@@ -158,7 +163,9 @@ jobs:
158163
- name: Build with maven
159164
if: ${{ hashFiles(format('josm/plugins/{0}/pom.xml', inputs.plugin-directory)) != '' }}
160165
run: |
166+
set -ex
161167
cd $GITHUB_WORKSPACE/josm/plugins/${{ inputs.plugin-directory }}
168+
ls ../../core/tools/checkstyle
162169
mvn --file ../../core/pom.xml package install -DskipTests
163170
mvn --file pom.xml package javadoc:jar source:jar -DskipTests -Dplugin.dist.dir=../../dist -Dplugin.version=${{ steps.version.outputs.version }}
164171
mv target/${{ inputs.plugin-jar-name }}-*-sources.jar ../../dist/${{ inputs.plugin-jar-name }}-sources.jar

.github/workflows/internal_ant.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,13 @@ jobs:
102102
# Count the total commits for this branch
103103
run: |
104104
revision="v$(($(git rev-list --count HEAD) + ${{ inputs.revision-offset }}))"
105-
git tag $revision
106-
git push -u origin $revision
105+
if [ $(git tag | grep '^'"$revision"'$' | wc -l) -eq 0 ]; then
106+
git tag $revision
107+
git push -u origin $revision
108+
elif [ $(git diff ${{ github.sha }}..$revision --name-only | wc -l) -ne 0 ]; then
109+
echo "Already existing tag pointing to different revision"
110+
exit 1
111+
fi
107112
echo "revision=$revision" >> $GITHUB_OUTPUT
108113
109114
plugin-build:
@@ -158,7 +163,9 @@ jobs:
158163
- name: Build with maven
159164
if: ${{ hashFiles(format('josm/plugins/{0}/pom.xml', inputs.plugin-directory)) != '' }}
160165
run: |
166+
set -ex
161167
cd $GITHUB_WORKSPACE/josm/plugins/${{ inputs.plugin-directory }}
168+
ls ../../core/tools/checkstyle
162169
mvn --file ../../core/pom.xml package install -DskipTests
163170
mvn --file pom.xml package javadoc:jar source:jar -DskipTests -Dplugin.dist.dir=../../dist -Dplugin.version=${{ steps.version.outputs.version }}
164171
mv target/${{ inputs.plugin-jar-name }}-*-sources.jar ../../dist/${{ inputs.plugin-jar-name }}-sources.jar

0 commit comments

Comments
 (0)