Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly set Bundle-Version in META-INF on release #2505

Merged
merged 1 commit into from Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/util/ManifestReversion.java
Expand Up @@ -12,7 +12,9 @@
public class ManifestReversion {
public static void main(String[] args) throws Exception {
String filename = args[0];
String version = args[1];
String version = args[1]
.replaceFirst("^v", "");

Manifest manifest;
try (InputStream input = new FileInputStream(filename)) {
manifest = new Manifest(input);
Expand All @@ -21,7 +23,8 @@ public static void main(String[] args) throws Exception {

attributes.putValue("Liquibase-Version", version);

if (attributes.containsKey("Bundle-Version")) {
final String bundleVersion = attributes.getValue("Bundle-Version");
if (bundleVersion != null) {
attributes.putValue("Bundle-Version", version);
}

Expand Down
16 changes: 16 additions & 0 deletions .github/util/re-version.sh
Expand Up @@ -55,6 +55,22 @@ do

cp $workdir/$jar $outdir
rename.ul 0-SNAPSHOT $version $outdir/$jar

## Make sure there are no left-over 0-SNAPSHOT versions
mkdir -p $workdir/test
unzip -q $outdir/*.jar -d $workdir/test

if grep -rl "0-SNAPSHOT" $workdir/test; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad that we have this test, @nvoxland. Does this run as part of the release build, or is it something we need to run manually? If it is manual, let's add it to our internal release documentation.

echo "Found '0-SNAPSHOT' in re-versioned jars"
exit 1
fi

if grep -rl "0.0.0.SNAPSHOT" $workdir/test; then
echo "Found '0.0.0.SNAPSHOT' in re-versioned jars"
exit 1
fi

rm -rf $workdir/test
done

#### Update javadoc jars
Expand Down