Moxie's deploy task updates the `artifacts.json` file in the Maven
repository. But it does rewrite the whole file, not just add the
newly deployed artifacts. Which causes the "last updated" dates for
all artifacts in the repository to be rewritten.
In our case, where the repository is a Git repo, if the Git repo is a
fresh checkout, that resets all the dates to the checkout date.
Therefore we adjust the `artifacts.json` file to only keep the
update for the newly deployed artifacts, removing the other updates
for the dates with some awk magic.
working-directory: gitblit-maven
run: |
. ${versinfo}
+ git diff -R -U2 -- artifacts.json | awk 'BEGIN{FS="\n" ; RS="@"; ORS="@"} { for (i=1;i<=NF;i++){if ($i ~ /description/) {print "Skip block";next;}} print $0 }' | sed -e 's/^@@ .* @@Skip block//' -e '/^@$/ d' | patch -p1 artifacts.json
+ git diff -- artifacts.json
git add .
git commit -m "Release $GB_RELEASE_VERSION artifacts"
-
+
- name: Update website
working-directory: gitblit
run: |