Skip to content

Commit

Permalink
infra: diable new curl option as it absent in CI and my local
Browse files Browse the repository at this point in the history
  • Loading branch information
romani authored and nrmancuso committed Nov 28, 2022
1 parent af8cf70 commit 62a765a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions config/checkstyle_non_main_files_suppressions.xml
Expand Up @@ -167,5 +167,6 @@
<suppress id="properCurlCommand" files=".ci[\\/]update-github-milestone\.sh"/>
<suppress id="properCurlCommand" files=".ci[\\/]releasenotes-gen-xdoc-push\.sh"/>
<suppress id="properCurlCommand" files=".ci[\\/]creation-of-issue-in-other-repos\.sh"/>
<suppress id="properCurlCommand" files="release\.sh"/>

</suppressions>
16 changes: 8 additions & 8 deletions release.sh
Expand Up @@ -64,7 +64,7 @@ FUTURE_RELEASE=$(xmlstarlet sel -N pom=http://maven.apache.org/POM/4.0.0 \
TKN=$(cat ~/.m2/token-checkstyle.txt)

echo "Updating Github tag page"
curl --fail-with-body -i -H "Authorization: token $TKN" \
curl -i -H "Authorization: token $TKN" \
-d "{ \"tag_name\": \"checkstyle-$NEW_RELEASE\", \
\"target_commitish\": \"master\", \
\"name\": \"\", \
Expand All @@ -73,19 +73,19 @@ curl --fail-with-body -i -H "Authorization: token $TKN" \
-X POST https://api.github.com/repos/checkstyle/checkstyle/releases

echo "Publishing 'all' jar to Github"
RELEASE_ID=$(curl --fail-with-body -s -X GET \
RELEASE_ID=$(curl -s -X GET \
https://api.github.com/repos/checkstyle/checkstyle/releases/tags/checkstyle-"$NEW_RELEASE" \
| jq ".id")
curl --fail-with-body -i -H "Authorization: token $TKN" \
curl -i -H "Authorization: token $TKN" \
-H "Content-Type: application/zip" \
--data-binary @"target/checkout/target/checkstyle-$NEW_RELEASE-all.jar" \
-X POST https://uploads.github.com/repos/checkstyle/checkstyle/releases/"$RELEASE_ID"/assets?name=checkstyle-"$NEW_RELEASE"-all.jar

echo "Close previous milestone at github"
MILESTONE_ID=$(curl --fail-with-body -s \
MILESTONE_ID=$(curl -s \
-X GET https://api.github.com/repos/checkstyle/checkstyle/milestones?state=open \
| jq ".[0] | .number")
curl --fail-with-body -i -H "Authorization: token $TKN" \
curl -i -H "Authorization: token $TKN" \
-d "{ \"state\": \"closed\" }" \
-X PATCH https://api.github.com/repos/checkstyle/checkstyle/milestones/"$MILESTONE_ID"

Expand All @@ -95,7 +95,7 @@ LAST_SUNDAY_DAY=$(cal -d "$(date -d "next month" +"%Y-%m")" \
| awk '/^ *[0-9]/ { d=$1 } END { print d }')
LAST_SUNDAY_DATETIME=$(date -d "next month" +"%Y-%m")"-$LAST_SUNDAY_DAY""T08:00:00Z"
echo "$LAST_SUNDAY_DATETIME"
curl --fail-with-body -i -H "Authorization: token $TKN" \
curl -i -H "Authorization: token $TKN" \
-d "{ \"title\": \"$FUTURE_RELEASE\", \
\"state\": \"open\", \
\"description\": \"\", \
Expand All @@ -104,14 +104,14 @@ curl --fail-with-body -i -H "Authorization: token $TKN" \
-X POST https://api.github.com/repos/checkstyle/checkstyle/milestones

echo "Creation of issue in eclipse-cs repo ..."
curl --fail-with-body -i -H "Authorization: token $TKN" \
curl -i -H "Authorization: token $TKN" \
-d "{ \"title\": \"upgrade to checkstyle $NEW_RELEASE\", \
\"body\": \"https://checkstyle.org/releasenotes.html#Release_$NEW_RELEASE\" \
}" \
-X POST https://api.github.com/repos/checkstyle/eclipse-cs/issues

echo "Creation of issue in sonar-checkstyle repo ..."
curl --fail-with-body -i -H "Authorization: token $TKN" \
curl -i -H "Authorization: token $TKN" \
-d "{ \"title\": \"upgrade to checkstyle $NEW_RELEASE\", \
\"body\": \"https://checkstyle.org/releasenotes.html#Release_$NEW_RELEASE\" \
}" \
Expand Down

0 comments on commit 62a765a

Please sign in to comment.