2022-01-12 07:40:46 +00:00
#!/usr/bin/env bash
set -ex
2023-05-12 11:42:34 +00:00
find . -name "*.jar"
2023-05-12 14:50:31 +00:00
find . -name "*.asc"
2023-05-12 11:42:34 +00:00
2022-01-12 07:40:46 +00:00
TAG = "snapshot"
DATE_TIME_UTC = $( date -u +"%F at %T (UTC)" )
gh release delete " ${ TAG } " -y || true
git tag --force " ${ TAG } "
git push --force origin " ${ TAG } "
2023-05-12 11:42:34 +00:00
mkdir "github_release"
2022-01-12 07:40:46 +00:00
2023-05-12 11:42:34 +00:00
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"
2023-07-04 08:15:07 +00:00
cp " plantuml-asl/build/libs/plantuml-asl- ${ RELEASE_VERSION } .jar " "github_release/plantuml-asl-SNAPSHOT.jar"
cp " plantuml-asl/build/libs/plantuml-asl- ${ RELEASE_VERSION } -javadoc.jar " "github_release/plantuml-asl-SNAPSHOT-javadoc.jar"
cp " plantuml-asl/build/libs/plantuml-asl- ${ RELEASE_VERSION } -sources.jar " "github_release/plantuml-asl-SNAPSHOT-sources.jar"
cp " plantuml-bsd/build/libs/plantuml-bsd- ${ RELEASE_VERSION } .jar " "github_release/plantuml-bsd-SNAPSHOT.jar"
cp " plantuml-bsd/build/libs/plantuml-bsd- ${ RELEASE_VERSION } -javadoc.jar " "github_release/plantuml-bsd-SNAPSHOT-javadoc.jar"
cp " plantuml-bsd/build/libs/plantuml-bsd- ${ RELEASE_VERSION } -sources.jar " "github_release/plantuml-bsd-SNAPSHOT-sources.jar"
cp " plantuml-epl/build/libs/plantuml-epl- ${ RELEASE_VERSION } .jar " "github_release/plantuml-epl-SNAPSHOT.jar"
cp " plantuml-epl/build/libs/plantuml-epl- ${ RELEASE_VERSION } -javadoc.jar " "github_release/plantuml-epl-SNAPSHOT-javadoc.jar"
cp " plantuml-epl/build/libs/plantuml-epl- ${ RELEASE_VERSION } -sources.jar " "github_release/plantuml-epl-SNAPSHOT-sources.jar"
cp " plantuml-lgpl/build/libs/plantuml-lgpl- ${ RELEASE_VERSION } .jar " "github_release/plantuml-lgpl-SNAPSHOT.jar"
cp " plantuml-lgpl/build/libs/plantuml-lgpl- ${ RELEASE_VERSION } -javadoc.jar " "github_release/plantuml-lgpl-SNAPSHOT-javadoc.jar"
cp " plantuml-lgpl/build/libs/plantuml-lgpl- ${ RELEASE_VERSION } -sources.jar " "github_release/plantuml-lgpl-SNAPSHOT-sources.jar"
2023-05-12 14:03:57 +00:00
cp " plantuml-mit/build/libs/plantuml-mit- ${ RELEASE_VERSION } .jar " "github_release/plantuml-mit-SNAPSHOT.jar"
2023-05-12 19:46:37 +00:00
cp " plantuml-mit/build/libs/plantuml-mit- ${ RELEASE_VERSION } -javadoc.jar " "github_release/plantuml-mit-SNAPSHOT-javadoc.jar"
2023-05-12 14:03:57 +00:00
cp " plantuml-mit/build/libs/plantuml-mit- ${ RELEASE_VERSION } -sources.jar " "github_release/plantuml-mit-SNAPSHOT-sources.jar"
2022-01-12 07:40:46 +00:00
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
2023-05-12 11:42:34 +00:00
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"
2023-07-04 08:15:07 +00:00
cp " plantuml-asl/build/libs/plantuml-asl- ${ RELEASE_VERSION } .jar.asc " "github_release/plantuml-asl-SNAPSHOT.jar.asc"
cp " plantuml-asl/build/libs/plantuml-asl- ${ RELEASE_VERSION } -javadoc.jar.asc " "github_release/plantuml-asl-SNAPSHOT-javadoc.jar.asc"
cp " plantuml-asl/build/libs/plantuml-asl- ${ RELEASE_VERSION } -sources.jar.asc " "github_release/plantuml-asl-SNAPSHOT-sources.jar.asc"
cp " plantuml-bsd/build/libs/plantuml-bsd- ${ RELEASE_VERSION } .jar.asc " "github_release/plantuml-bsd-SNAPSHOT.jar.asc"
cp " plantuml-bsd/build/libs/plantuml-bsd- ${ RELEASE_VERSION } -javadoc.jar.asc " "github_release/plantuml-bsd-SNAPSHOT-javadoc.jar.asc"
cp " plantuml-bsd/build/libs/plantuml-bsd- ${ RELEASE_VERSION } -sources.jar.asc " "github_release/plantuml-bsd-SNAPSHOT-sources.jar.asc"
cp " plantuml-epl/build/libs/plantuml-epl- ${ RELEASE_VERSION } .jar.asc " "github_release/plantuml-epl-SNAPSHOT.jar.asc"
cp " plantuml-epl/build/libs/plantuml-epl- ${ RELEASE_VERSION } -javadoc.jar.asc " "github_release/plantuml-epl-SNAPSHOT-javadoc.jar.asc"
cp " plantuml-epl/build/libs/plantuml-epl- ${ RELEASE_VERSION } -sources.jar.asc " "github_release/plantuml-epl-SNAPSHOT-sources.jar.asc"
cp " plantuml-lgpl/build/libs/plantuml-lgpl- ${ RELEASE_VERSION } .jar.asc " "github_release/plantuml-lgpl-SNAPSHOT.jar.asc"
cp " plantuml-lgpl/build/libs/plantuml-lgpl- ${ RELEASE_VERSION } -javadoc.jar.asc " "github_release/plantuml-lgpl-SNAPSHOT-javadoc.jar.asc"
cp " plantuml-lgpl/build/libs/plantuml-lgpl- ${ RELEASE_VERSION } -sources.jar.asc " "github_release/plantuml-lgpl-SNAPSHOT-sources.jar.asc"
2023-05-12 14:21:45 +00:00
cp " plantuml-mit/build/libs/plantuml-mit- ${ RELEASE_VERSION } .jar.asc " "github_release/plantuml-mit-SNAPSHOT.jar.asc"
2023-05-12 19:46:37 +00:00
cp " plantuml-mit/build/libs/plantuml-mit- ${ RELEASE_VERSION } -javadoc.jar.asc " "github_release/plantuml-mit-SNAPSHOT-javadoc.jar.asc"
2023-05-12 14:21:45 +00:00
cp " plantuml-mit/build/libs/plantuml-mit- ${ RELEASE_VERSION } -sources.jar.asc " "github_release/plantuml-mit-SNAPSHOT-sources.jar.asc"
2022-01-12 07:40:46 +00:00
fi
2023-05-12 11:42:34 +00:00
echo -n " ${ DATE_TIME_UTC } " > "github_release/plantuml-SNAPSHOT.timestamp"
2022-01-12 07:40:46 +00:00
cat <<-EOF >notes.txt
2023-03-26 17:11:14 +00:00
## Version ~v${RELEASE_VERSION%-SNAPSHOT} of the ${DATE_TIME_UTC}
2022-01-12 07:40:46 +00:00
This is a pre-release of [ the latest development work] ( https://github.com/plantuml/plantuml/commits/) .
⚠️ **It is not ready for general use** ⚠️
⏱ _Snapshot taken the ${ DATE_TIME_UTC } _
EOF
gh release create \
--prerelease \
--target " ${ GITHUB_SHA } " \
2023-03-26 17:11:14 +00:00
--title " ${ TAG } (~v ${ RELEASE_VERSION %-SNAPSHOT } ) " \
2022-01-12 07:40:46 +00:00
--notes-file notes.txt \
2023-05-12 11:42:34 +00:00
" ${ TAG } " github_release/*
2022-01-12 07:40:46 +00:00
2023-03-26 17:11:14 +00:00
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 } "