@@ -62,8 +62,9 @@ function snapshot_build() {
6262 cd net.sourceforge.pmd.eclipse.p2updatesite
6363 ./cleanup-bintray-snapshots.sh
6464 )
65+ pmd_ci_log_group_end
6566
66- # Add snapshot to update site
67+ pmd_ci_log_group_start " Add snapshot to update site"
6768 pmd_ci_log_info " Updating pmd-eclipse-plugin-p2-site..."
6869 prepare_local_p2_site
6970 (
@@ -88,14 +89,16 @@ function release_build() {
8889 pmd_ci_log_group_start " Release Build: ${PMD_CI_MAVEN_PROJECT_VERSION} "
8990 pmd_ci_log_info " This is a release build for tag ${PMD_CI_TAG} (version: ${PMD_CI_MAVEN_PROJECT_VERSION} )"
9091
91- # create a draft github release
92- pmd_ci_gh_releases_createDraftRelease " ${PMD_CI_TAG} " " $( git rev-list -n 1 " ${PMD_CI_TAG} " ) "
93- GH_RELEASE=" $RESULT "
94-
9592 # Build and deploy the update site to bintray
9693 xvfb-run --auto-servernum ./mvnw clean verify --show-version --errors --batch-mode \
9794 --no-transfer-progress \
9895 --activate-profiles release-composite
96+ pmd_ci_log_group_end
97+
98+ pmd_ci_log_group_start " Update Github Releases"
99+ # create a draft github release
100+ pmd_ci_gh_releases_createDraftRelease " ${PMD_CI_TAG} " " $( git rev-list -n 1 " ${PMD_CI_TAG} " ) "
101+ GH_RELEASE=" $RESULT "
99102
100103 # Deploy to github releases
101104 pmd_ci_gh_releases_uploadAsset " $GH_RELEASE " " net.sourceforge.pmd.eclipse.p2updatesite/target/net.sourceforge.pmd.eclipse.p2updatesite-${PMD_CI_MAVEN_PROJECT_VERSION} .zip"
@@ -116,8 +119,9 @@ $(head -$END_LINE ReleaseNotes.md | tail -$((END_LINE - BEGIN_LINE)))
116119
117120 # Upload it to sourceforge
118121 pmd_ci_sourceforge_uploadFile " pmd-eclipse/zipped" " net.sourceforge.pmd.eclipse.p2updatesite/target/net.sourceforge.pmd.eclipse.p2updatesite-${PMD_CI_MAVEN_PROJECT_VERSION} .zip"
122+ pmd_ci_log_group_end
119123
120- # Add new release to update site
124+ pmd_ci_log_group_start " Add new release to update site"
121125 pmd_ci_log_info " Updating pmd-eclipse-plugin-p2-site..."
122126 prepare_local_p2_site
123127 (
@@ -133,11 +137,10 @@ $(head -$END_LINE ReleaseNotes.md | tail -$((END_LINE - BEGIN_LINE)))
133137 git push --force origin gh-pages-2:gh-pages
134138 pmd_ci_log_success " Successfully updated https://pmd.github.io/pmd-eclipse-plugin-p2-site/"
135139 )
136-
137- # Publish release - this sends out notifications on github
138- pmd_ci_gh_releases_publishRelease " $GH_RELEASE "
139-
140140 pmd_ci_log_group_end
141+
142+ # Publish release - this sends out notifications on github
143+ pmd_ci_gh_releases_publishRelease " $GH_RELEASE "
141144}
142145
143146
@@ -147,11 +150,11 @@ function prepare_local_p2_site() {
147150 mkdir current-p2-site
148151 (
149152 cd current-p2-site
150- git init -q
153+ git init -q --initial-branch=gh-pages
151154 git config user.name " PMD CI (pmd-bot)"
152155 git config user.email
" [email protected] " 153156 git remote add origin
[email protected] :pmd/pmd-eclipse-plugin-p2-site.git
154- git pull origin gh-pages
157+ git pull --rebase origin gh-pages
155158 )
156159}
157160
0 commit comments