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"
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-05-12 14:03:57 +00:00
cp " plantuml-mit/build/libs/plantuml-mit- ${ RELEASE_VERSION } .jar " "github_release/plantuml-mit-SNAPSHOT.jar"
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-05-12 14:32:51 +00:00
ls -l build/libs
ls -l plantuml-mit/build/libs
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"
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 } "