-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathupdate-version.sh
More file actions
executable file
·37 lines (28 loc) · 1.38 KB
/
Copy pathupdate-version.sh
File metadata and controls
executable file
·37 lines (28 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env sh
# This script is used for updating the version of the whole plugin.
#
# Usage: ./update-version.sh VERSION
# Example: ./update-version.sh 3.1.0-SNAPSHOT
# Note that automatically updating the version only works when the versions
# in the files have not been manually edited and actually match the current
# version.
VERSION="$*"
if [ -z "$VERSION" ]; then
echo "update-version.sh VERSION"
exit 1
fi
M3_VERSION=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/apache/maven/releases/latest | sed 's,https://github.com/apache/maven/releases/tag/maven-,,g')
# Extract the Tycho version from pom.xml
TYCHO_VERSION=$(grep "<tycho.version>" pom.xml | sed 's/.*<tycho.version>\(.*\)<\/tycho.version>.*/\1/')
# Use the extracted Tycho version and maven wrapper
mvn wrapper:wrapper -Dmaven=${M3_VERSION} --no-transfer-progress
./mvnw \
org.eclipse.tycho:tycho-versions-plugin:${TYCHO_VERSION}:set-version \
-DnewVersion="$VERSION" -Dtycho.mode=maven --no-transfer-progress
./mvnw \
org.eclipse.tycho:tycho-versions-plugin:${TYCHO_VERSION}:update-eclipse-metadata \
-DnewVersion="$VERSION" -Dtycho.mode=maven --no-transfer-progress
BUILD_DATE=$(date +%Y%m%d)
# Requires GNU sed (as provided by ubuntu-latest runners)
sed -i "s/^0=.*/0=${BUILD_DATE}/" io.github.nbauma109.decompiler/about.mappings
sed -i "s/^1=.*/1=${VERSION}/" io.github.nbauma109.decompiler/about.mappings