mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
Fix update website script to be able to run Linux
This commit is contained in:
parent
6365a606c1
commit
0f24633d04
20
.github/scripts/update-website.sh
vendored
20
.github/scripts/update-website.sh
vendored
@ -38,16 +38,22 @@ STABLE_VERSION=`grep stableVersion config.toml | sed 's/.*"\(.*\)"/\1/'`
|
|||||||
MAJOR_MINOR_STABLE_VERSION=$(computeMajorMinorVersion $STABLE_VERSION)
|
MAJOR_MINOR_STABLE_VERSION=$(computeMajorMinorVersion $STABLE_VERSION)
|
||||||
|
|
||||||
echo "📝 Updating versions"
|
echo "📝 Updating versions"
|
||||||
sed -i '' -e "s/^devVersion = \"\(.*\)\"/devVersion = \"${VERSION}\"/g" config.toml
|
|
||||||
|
SEDOPTION="-i"
|
||||||
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
|
SEDOPTION="-i ''"
|
||||||
|
fi
|
||||||
|
|
||||||
|
sed $SEDOPTION -e "s/^devVersion = \"\(.*\)\"/devVersion = \"${VERSION}\"/g" config.toml
|
||||||
|
|
||||||
if [ "${STABLE}" == "yes" ]; then
|
if [ "${STABLE}" == "yes" ]; then
|
||||||
sed -i '' -e "s/^stableVersion = \"\(.*\)\"/stableVersion = \"${VERSION}\"/g" config.toml
|
sed $SEDOPTION -e "s/^stableVersion = \"\(.*\)\"/stableVersion = \"${VERSION}\"/g" config.toml
|
||||||
if [ "${MAJOR_MINOR_STABLE_VERSION}" != ${MAJOR_MINOR_VERSION} ]; then
|
if [ "${MAJOR_MINOR_STABLE_VERSION}" != ${MAJOR_MINOR_VERSION} ]; then
|
||||||
echo "📝 Updating new stable version"
|
echo "📝 Updating new stable version"
|
||||||
# This means that we have a new stable version and we need to change the order of the releases.
|
# This means that we have a new stable version and we need to change the order of the releases.
|
||||||
sed -i '' -e "s/^order = \(.*\)/order = 500/g" data/releases/${MAJOR_MINOR_VERSION}.toml
|
sed $SEDOPTION -e "s/^order = \(.*\)/order = 500/g" data/releases/${MAJOR_MINOR_VERSION}.toml
|
||||||
NEXT_STABLE_ORDER=$((`ls -1 data/releases | wc -l` - 2))
|
NEXT_STABLE_ORDER=$((`ls -1 data/releases | wc -l` - 2))
|
||||||
sed -i '' -e "s/^order = \(.*\)/order = ${NEXT_STABLE_ORDER}/g" data/releases/${MAJOR_MINOR_STABLE_VERSION}.toml
|
sed $SEDOPTION -e "s/^order = \(.*\)/order = ${NEXT_STABLE_ORDER}/g" data/releases/${MAJOR_MINOR_STABLE_VERSION}.toml
|
||||||
git add data/releases/${MAJOR_MINOR_STABLE_VERSION}.toml
|
git add data/releases/${MAJOR_MINOR_STABLE_VERSION}.toml
|
||||||
fi
|
fi
|
||||||
elif [ "${MAJOR_MINOR_DEV_VERSION}" != "${MAJOR_MINOR_VERSION}" ]; then
|
elif [ "${MAJOR_MINOR_DEV_VERSION}" != "${MAJOR_MINOR_VERSION}" ]; then
|
||||||
@ -55,11 +61,11 @@ elif [ "${MAJOR_MINOR_DEV_VERSION}" != "${MAJOR_MINOR_VERSION}" ]; then
|
|||||||
# This means that we are updating for a new dev version, but the last dev version is not the one that we are doing.
|
# This means that we are updating for a new dev version, but the last dev version is not the one that we are doing.
|
||||||
# Therefore, we need to update add the new data configuration
|
# Therefore, we need to update add the new data configuration
|
||||||
cp data/releases/${MAJOR_MINOR_DEV_VERSION}.toml data/releases/${MAJOR_MINOR_VERSION}.toml
|
cp data/releases/${MAJOR_MINOR_DEV_VERSION}.toml data/releases/${MAJOR_MINOR_VERSION}.toml
|
||||||
sed -i '' -e "s/^order = \(.*\)/order = 1000/g" data/releases/${MAJOR_MINOR_VERSION}.toml
|
sed $SEDOPTION -e "s/^order = \(.*\)/order = 1000/g" data/releases/${MAJOR_MINOR_VERSION}.toml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed -i '' -e "s/^name = \"\(.*\)\"/name = \"${VERSION}\"/g" data/releases/${MAJOR_MINOR_VERSION}.toml
|
sed $SEDOPTION -e "s/^name = \"\(.*\)\"/name = \"${VERSION}\"/g" data/releases/${MAJOR_MINOR_VERSION}.toml
|
||||||
sed -i '' -e "s/^releaseDate = \(.*\)/releaseDate = $(date +%F)/g" data/releases/${MAJOR_MINOR_VERSION}.toml
|
sed $SEDOPTION -e "s/^releaseDate = \(.*\)/releaseDate = $(date +%F)/g" data/releases/${MAJOR_MINOR_VERSION}.toml
|
||||||
git add data/releases/${MAJOR_MINOR_VERSION}.toml
|
git add data/releases/${MAJOR_MINOR_VERSION}.toml
|
||||||
git add config.toml
|
git add config.toml
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user