diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 8ac8a39..1012af6 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -36,16 +36,28 @@ jobs: echo "[INFO] Artifact name: $artifact" mvn versions:set -DnewVersion="$version" mvn package -DskipTests - gpg -ab pom.xml cd target + rm -rf ee/sk/smartid/smart-id-java-client/$version + mkdir -p ee/sk/smartid/smart-id-java-client/$version + cp $artifact.jar ee/sk/smartid/smart-id-java-client/$version/ + cp $artifact-sources.jar ee/sk/mid/mid-rest-java-client/$version/ + cp $artifact-javadoc.jar ee/sk/mid/mid-rest-java-client/$version/ + cp ../pom.xml ee/sk/mid/mid-rest-java-client/$version/$artifact.pom + cd ee/sk/mid/mid-rest-java-client/$version + gpg -ab $artifact.pom gpg -ab $artifact.jar gpg -ab $artifact-sources.jar gpg -ab $artifact-javadoc.jar - jar -cvf bundle.jar ../pom.xml ../pom.xml.asc $artifact.jar $artifact.jar.asc $artifact-javadoc.jar $artifact-javadoc.jar.asc $artifact-sources.jar $artifact-sources.jar.asc - CODE=$(curl -w "%{http_code}" -o curl_response.txt -s -ujorlina2 -u ${{ secrets.SONATYPETOKENUN }}:${{ secrets.SONATYPETOKENPW }} --request POST -F "file=@bundle.jar" "https://oss.sonatype.org/service/local/staging/bundle_upload") + find . -type f \( -name '*.jar' -o -name '*.pom' \) -exec sh -c 'for file; do sha512sum "$file" | cut -d " " -f 1 > "$file.sha512"; done' _ {} + + find . -type f \( -name '*.jar' -o -name '*.pom' \) -exec sh -c 'for file; do sha256sum "$file" | cut -d " " -f 1 > "$file.sha256"; done' _ {} + + find . -type f \( -name '*.jar' -o -name '*.pom' \) -exec sh -c 'for file; do sha1sum "$file" | cut -d " " -f 1 > "$file.sha1"; done' _ {} + + find . -type f \( -name '*.jar' -o -name '*.pom' \) -exec sh -c 'for file; do md5sum "$file" | cut -d " " -f 1 > "$file.md5"; done' _ {} + + cd ../../../../../ + zip bundle.zip ee/sk/mid/mid-rest-java-client/$version/* + CODE=$(curl -w "%{http_code}" -o curl_response.txt -s --request POST --verbose --header 'Authorization: Bearer ${{ secrets.SONATYPETOKEN }}' --form bundle=@bundle.zip https://central.sonatype.com/api/v1/publisher/upload) echo "[INFO] ------------------------------------------------------------------------" - echo "[INFO] Upload to oss.sonatype.org ResponseCode: $CODE" + echo "[INFO] Upload to central.sonatype.com ResponseCode: $CODE" cat curl_response.txt - echo -e "\n[INFO] Login to oss.sonatype.org for releasing $artifact" + echo -e "\n[INFO] Login to central.sonatype.com for releasing $artifact" echo "[INFO] ------------------------------------------------------------------------" - [[ $CODE == 201 ]] && exit 0 || exit 1 \ No newline at end of file + [[ $CODE == 201 ]] && exit 0 || exit 1