Skip to content

Commit

Permalink
Merge pull request #24 from ThePrez/mavenize
Browse files Browse the repository at this point in the history
Mavenize, bump version to 2.x, and build with GH actions
  • Loading branch information
jwoehr authored Feb 1, 2022
2 parents 4f2a22a + 9c0b7e3 commit c9aec30
Show file tree
Hide file tree
Showing 219 changed files with 523 additions and 2,176 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Build new release
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: maven
- name: Build project
run: make dist
- name: Create the release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload .zip file to release
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./ublu-dist.zip
asset_name: ublu-dist.zip
asset_content_type: application/zip
28 changes: 28 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Build the Distribution
run: make dist
13 changes: 10 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
/dist/
/src/ublu/Version.java
/target/
/src/main/java/ublu/Version.java
/lib/postgresql-9.2-1003.jdbc4.jar
/oldlib/
/nbproject/private/
/build/
/lib/mssql-jdbc-7.0.0.jre8.jar
/lib/mssql-jdbc-7.0.0.jre8.jar
/ublu-dist.zip
/dist-build/
/dist/
MakeVer.class
.classpath
.project
.settings/
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
target/ublu.jar: FORCE
rm -f src/main/java/ublu/Version.java
rm -rf target
mvn package
cp target/ublu-*-with-dependencies.jar target/ublu.jar

FORCE:

clean:
rm -rf target dist-build ublu-dist.zip src/main/java/ublu/Version.java MakeVer.class

dist: target/ublu.jar
rm -fr dist-build
mkdir dist-build
cp target/ublu.jar dist-build/ublu.jar
cp -R bin dist-build/
cp -R examples dist-build/
cp -R extensions dist-build/
cp -R man dist-build/
cp -R share dist-build/
cp -R userdoc dist-build/
mkdir -p dist-build/licenses
cp *license* dist-build/licenses
cp *LICENSE* dist-build/licenses
cd dist-build/ && zip -rmv ../ublu-dist.zip ./*
5 changes: 5 additions & 0 deletions Version.java.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package ublu;
class Version {
static String compileDateTime = "@timestamp@ (GMT)";
static String ubluVersion = "@ubluversion@";
}
22 changes: 21 additions & 1 deletion bin/ublu
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@

MYPGM=$0

# If we have readlink, use it to resolve the full path to this script.
# This is needed for the case where 'ublu' is just a symlink to
# somewhere else
if [ -x "/QOpenSys/pkgs/bin/readlink" ]
then
MYPGM=$(/QOpenSys/pkgs/bin/readlink -f $0)
elif [ -x "/usr/bin/readlink" ]
then
MYPGM=$(/usr/bin/readlink -f $0)
fi

# Usage message
function usage {
echo "Ublu is free open source software with NO WARRANTY and NO GUARANTEE, including as regards fitness for any application."
Expand Down Expand Up @@ -55,7 +66,16 @@ REMAINING_ARGS="$*"

if [ "$UBLU_CLASSPATH" == "" ]
then
UBLU_CLASSPATH="/opt/ublu/ublu.jar"
if [ -f $(dirname $MYPGM)/../ublu.jar ]
then
UBLU_CLASSPATH="$(dirname $MYPGM)/../ublu.jar"
elif [ -f /opt/ublu/ublu.jar ]
then
UBLU_CLASSPATH="/opt/ublu/ublu.jar"
else
echo "Ublu not found in /opt/ublu/ublu.jar or $(dirname $MYPGM)/../ublu.jar"
exit 1
fi
fi

if [ "$CLASSPATH" != "" ]
Expand Down
183 changes: 0 additions & 183 deletions build.xml

This file was deleted.

Binary file removed lib/postgresql-42.2.5.jre7.jar
Binary file not shown.
File renamed without changes.
9 changes: 9 additions & 0 deletions lib/ublu/staticlib/jt400/9.6-patched/jt400-9.6-patched.pom
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>ublu.staticlib</groupId>
<artifactId>jt400</artifactId>
<version>9.6-patched</version>
<description>POM was created from install:install-file</description>
</project>
12 changes: 12 additions & 0 deletions lib/ublu/staticlib/jt400/maven-metadata-local.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>ublu.staticlib</groupId>
<artifactId>jt400</artifactId>
<versioning>
<release>9.6-patched</release>
<versions>
<version>9.6-patched</version>
</versions>
<lastUpdated>20220201004916</lastUpdated>
</versioning>
</metadata>
12 changes: 12 additions & 0 deletions lib/ublu/staticlib/pigiron/maven-metadata-local.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>ublu.staticlib</groupId>
<artifactId>pigiron</artifactId>
<versioning>
<release>only</release>
<versions>
<version>only</version>
</versions>
<lastUpdated>20220201003103</lastUpdated>
</versioning>
</metadata>
File renamed without changes.
9 changes: 9 additions & 0 deletions lib/ublu/staticlib/pigiron/only/pigiron-only.pom
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>ublu.staticlib</groupId>
<artifactId>pigiron</artifactId>
<version>only</version>
<description>POM was created from install:install-file</description>
</project>
Loading

0 comments on commit c9aec30

Please sign in to comment.