From bb33824e878344d6b3d06f9f3729ee33f4179131 Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Fri, 12 May 2023 13:42:34 +0200 Subject: [PATCH] chore: slightly simplify release-snapshot.sh --- .github/scripts/release-snapshot.sh | 33 +++++++++++++++-------------- .github/workflows/ci.yml | 3 ++- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/scripts/release-snapshot.sh b/.github/scripts/release-snapshot.sh index ccce01065..92793263e 100755 --- a/.github/scripts/release-snapshot.sh +++ b/.github/scripts/release-snapshot.sh @@ -1,9 +1,10 @@ #!/usr/bin/env bash set -ex +find . -name "*.jar" + TAG="snapshot" DATE_TIME_UTC=$(date -u +"%F at %T (UTC)") -RELEASE_DIR="build/github_release" gh release delete "${TAG}" -y || true @@ -11,26 +12,26 @@ git tag --force "${TAG}" git push --force origin "${TAG}" -mkdir "${RELEASE_DIR}" +mkdir "github_release" -ln -s "../publications/maven/module.json" "${RELEASE_DIR}/plantuml-SNAPSHOT-module.json" -ln -s "../publications/maven/pom-default.xml" "${RELEASE_DIR}/plantuml-SNAPSHOT.pom" -ln -s "../libs/plantuml-${RELEASE_VERSION}.jar" "${RELEASE_DIR}/plantuml-SNAPSHOT.jar" -ln -s "../libs/plantuml-${RELEASE_VERSION}-javadoc.jar" "${RELEASE_DIR}/plantuml-SNAPSHOT-javadoc.jar" -ln -s "../libs/plantuml-${RELEASE_VERSION}-sources.jar" "${RELEASE_DIR}/plantuml-SNAPSHOT-sources.jar" -ln -s "../libs/plantuml-pdf-${RELEASE_VERSION}.jar" "${RELEASE_DIR}/plantuml-pdf-SNAPSHOT.jar" +cp "build/publications/maven/module.json" "github_release/plantuml-SNAPSHOT-module.json" +cp "build/publications/maven/pom-default.xml" "github_release/plantuml-SNAPSHOT.pom" +cp "build/libs/plantuml-${RELEASE_VERSION}.jar" "github_release/plantuml-SNAPSHOT.jar" +cp "build/libs/plantuml-${RELEASE_VERSION}-javadoc.jar" "github_release/plantuml-SNAPSHOT-javadoc.jar" +cp "build/libs/plantuml-${RELEASE_VERSION}-sources.jar" "github_release/plantuml-SNAPSHOT-sources.jar" +cp "build/libs/plantuml-pdf-${RELEASE_VERSION}.jar" "github_release/plantuml-pdf-SNAPSHOT.jar" if [[ -e "build/publications/maven/module.json.asc" ]]; then # signatures are optional so that forked repos can release snapshots without needing a gpg signing key - ln -s "../publications/maven/module.json.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT-module.json.asc" - ln -s "../publications/maven/pom-default.xml.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT.pom.asc" - ln -s "../libs/plantuml-${RELEASE_VERSION}.jar.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT.jar.asc" - ln -s "../libs/plantuml-${RELEASE_VERSION}-javadoc.jar.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT-javadoc.jar.asc" - ln -s "../libs/plantuml-${RELEASE_VERSION}-sources.jar.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT-sources.jar.asc" - ln -s "../libs/plantuml-pdf-${RELEASE_VERSION}.jar.asc" "${RELEASE_DIR}/plantuml-pdf-SNAPSHOT.jar.asc" + cp "build/publications/maven/module.json.asc" "github_release/plantuml-SNAPSHOT-module.json.asc" + cp "build/publications/maven/pom-default.xml.asc" "github_release/plantuml-SNAPSHOT.pom.asc" + cp "build/libs/plantuml-${RELEASE_VERSION}.jar.asc" "github_release/plantuml-SNAPSHOT.jar.asc" + cp "build/libs/plantuml-${RELEASE_VERSION}-javadoc.jar.asc" "github_release/plantuml-SNAPSHOT-javadoc.jar.asc" + cp "build/libs/plantuml-${RELEASE_VERSION}-sources.jar.asc" "github_release/plantuml-SNAPSHOT-sources.jar.asc" + cp "build/libs/plantuml-pdf-${RELEASE_VERSION}.jar.asc" "github_release/plantuml-pdf-SNAPSHOT.jar.asc" fi -echo -n "${DATE_TIME_UTC}" > "${RELEASE_DIR}/plantuml-SNAPSHOT.timestamp" +echo -n "${DATE_TIME_UTC}" > "github_release/plantuml-SNAPSHOT.timestamp" cat <<-EOF >notes.txt ## Version ~v${RELEASE_VERSION%-SNAPSHOT} of the ${DATE_TIME_UTC} @@ -44,6 +45,6 @@ gh release create \ --target "${GITHUB_SHA}" \ --title "${TAG} (~v${RELEASE_VERSION%-SNAPSHOT})" \ --notes-file notes.txt \ - "${TAG}" ${RELEASE_DIR}/* + "${TAG}" github_release/* echo "::notice title=release snapshot::Snapshot (~v${RELEASE_VERSION%-SNAPSHOT}) released at ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/tag/${TAG} and taken the ${DATE_TIME_UTC}" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14d8842a1..d48bc3068 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,10 +126,11 @@ jobs: run: sed -i "s/version = .*/version = $POM_VERSION/" gradle.properties - name: Build artifacts run: | - gradle -q clean build \ + gradle clean build \ pdfJar \ generateMetadataFileForMavenPublication generatePomFileForMavenPublication \ -x test + find . -name "*.jar" - name: Sign artifacts if: env.ORG_GRADLE_PROJECT_signingKey env: