2022-01-12 07:40:46 +00:00
#!/usr/bin/env bash
set -ex
2022-02-12 07:56:20 +00:00
POM_VERSION = $( gradle properties -q | grep "version:" | awk '{print $2}' )
2022-01-12 07:40:46 +00:00
TAG = "snapshot"
DATE_TIME_UTC = $( date -u +"%F at %T (UTC)" )
RELEASE_DIR = "build/github_release"
gh release delete " ${ TAG } " -y || true
git tag --force " ${ TAG } "
git push --force origin " ${ TAG } "
mkdir " ${ RELEASE_DIR } "
2022-02-12 07:56:20 +00:00
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- ${ POM_VERSION } .jar " " ${ RELEASE_DIR } /plantuml-SNAPSHOT.jar "
ln -s " ../libs/plantuml- ${ POM_VERSION } -javadoc.jar " " ${ RELEASE_DIR } /plantuml-SNAPSHOT-javadoc.jar "
ln -s " ../libs/plantuml- ${ POM_VERSION } -sources.jar " " ${ RELEASE_DIR } /plantuml-SNAPSHOT-sources.jar "
2022-02-13 11:47:46 +00:00
ln -s " ../libs/plantuml-pdf- ${ POM_VERSION } .jar " " ${ RELEASE_DIR } /plantuml-pdf-SNAPSHOT.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
2022-02-12 07:56:20 +00:00
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- ${ POM_VERSION } .jar.asc " " ${ RELEASE_DIR } /plantuml-SNAPSHOT.jar.asc "
ln -s " ../libs/plantuml- ${ POM_VERSION } -javadoc.jar.asc " " ${ RELEASE_DIR } /plantuml-SNAPSHOT-javadoc.jar.asc "
ln -s " ../libs/plantuml- ${ POM_VERSION } -sources.jar.asc " " ${ RELEASE_DIR } /plantuml-SNAPSHOT-sources.jar.asc "
2022-02-14 09:29:34 +00:00
ln -s " ../libs/plantuml-pdf- ${ POM_VERSION } .jar.asc " " ${ RELEASE_DIR } /plantuml-pdf-SNAPSHOT.jar.asc "
2022-01-12 07:40:46 +00:00
fi
echo -n " ${ DATE_TIME_UTC } " > " ${ RELEASE_DIR } /plantuml-SNAPSHOT.timestamp "
cat <<-EOF >notes.txt
2022-06-06 17:46:45 +00:00
## Version ~v${POM_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 } " \
2022-06-06 17:46:45 +00:00
--title " ${ TAG } (~v ${ POM_VERSION %-SNAPSHOT } ) " \
2022-01-12 07:40:46 +00:00
--notes-file notes.txt \
" ${ TAG } " ${ RELEASE_DIR } /*
2022-06-06 12:26:57 +00:00
echo " ::notice title=release snapshot::Snapshot (~v ${ POM_VERSION %-SNAPSHOT } ) released at ${ GITHUB_SERVER_URL } / ${ GITHUB_REPOSITORY } /releases/tag/ ${ TAG } and taken the ${ DATE_TIME_UTC } "