1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-09-29 15:29:04 +00:00
plantuml/.github/scripts/release-snapshot.sh
The-Lum 19d7fba544
chore: Add MIT License (jar, source) version on CI [skip actions] (#1375)
* Add MIT version on CI

* chore: add gradle project for plantuml-mit

* chore: add publish to gradle project plantuml-mit

* chore: suppress test on u20 win19, add MIT on release script

Suppress ubuntu20 and win2019 test
Test of symbolic link on release script for MIT license
Delete now not used files:
- ci-mit.yml
- license-mit.yml
- build-mit.gradle.kts

* fix: side effect of MIT on Native CI

* fix(build): update paths to mit jars

---------

Co-authored-by: Eric Vantillard <eric.vantillard@evaxion.fr>
2023-04-05 12:13:14 +02:00

55 lines
3.0 KiB
Bash
Executable File

#!/usr/bin/env bash
set -ex
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}"
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"
ln -s "../libs/plantuml-linux-amd64-${RELEASE_VERSION}" "${RELEASE_DIR}/plantuml-linux-amd64-SNAPSHOT"
ln -s "../libs/plantuml-darwin-amd64-${RELEASE_VERSION}" "${RELEASE_DIR}/plantuml-darwin-amd64-SNAPSHOT"
ln -s "../libs/plantuml-win-amd64-${RELEASE_VERSION}.exe" "${RELEASE_DIR}/plantuml-win-amd64-SNAPSHOT.exe"
ln -s "../plantuml-mit/build/libs/plantuml-mit-${RELEASE_VERSION}.jar" "${RELEASE_DIR}/plantuml-mit-SNAPSHOT.jar"
ln -s "../plantuml-mit/build/libs/plantuml-mit-${RELEASE_VERSION}-sources.jar" "${RELEASE_DIR}/plantuml-mit-SNAPSHOT-sources.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"
fi
echo -n "${DATE_TIME_UTC}" > "${RELEASE_DIR}/plantuml-SNAPSHOT.timestamp"
cat <<-EOF >notes.txt
## Version ~v${RELEASE_VERSION%-SNAPSHOT} of the ${DATE_TIME_UTC}
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}" \
--title "${TAG} (~v${RELEASE_VERSION%-SNAPSHOT})" \
--notes-file notes.txt \
"${TAG}" ${RELEASE_DIR}/*
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}"