From fc093f168d78a4f831b66eb939cf5b0398aa55be Mon Sep 17 00:00:00 2001 From: Florian Zschocke Date: Sat, 1 Feb 2020 09:35:57 +0100 Subject: [PATCH] ci: Remove incorrect changes from the Maven artifacts.json file 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. --- .github/workflows/gitblit-release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gitblit-release.yml b/.github/workflows/gitblit-release.yml index 0b6f5c1f..25310fb0 100644 --- a/.github/workflows/gitblit-release.yml +++ b/.github/workflows/gitblit-release.yml @@ -148,9 +148,11 @@ jobs: 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: | -- 2.39.5