diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..0fc3336ac --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,113 @@ +name: Build and Publish Geoweaver App + +on: + release: + types: + - published + tags: + - '*' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + + - name: Build with Maven + run: mvn clean install -DskipTests + + - name: Install XML parsing tools + run: sudo apt-get update && sudo apt-get install -y libxml2-utils + + - name: Extract version from pom.xml + run: | + VERSION=$(xmllint --xpath "/*[local-name()='project']/*[local-name()='version']/text()" $GITHUB_WORKSPACE/pom.xml) + echo "VERSION=$VERSION" >> $GITHUB_ENV + + - name: Append version to DEBIAN/control + run: | + echo "Version: ${{ env.VERSION }}" >> $GITHUB_WORKSPACE/linux-deployment/DEBIAN/control + + - name: Set execute permissions for postinst script + run: chmod 755 $GITHUB_WORKSPACE/linux-deployment/DEBIAN/postinst + + - name: Copy geoweaver.jar to linux-deployment directory + run: cp $GITHUB_WORKSPACE/target/geoweaver.jar $GITHUB_WORKSPACE/linux-deployment/usr/local/bin/ + + - name: Make geoweaver.sh executable + run: chmod +x $GITHUB_WORKSPACE/linux-deployment/usr/local/bin/geoweaver.sh + + - name: Build deb package + run: | + cd $GITHUB_WORKSPACE/linux-deployment + dpkg-deb --build . geoweaver.deb + + - name: Upload Geoweaver Artifacts + uses: actions/upload-artifact@v2 + with: + name: geoweaver-artifacts + path: | + target/*.jar + pom.xml + linux-deployment/*.deb + + release: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Install XML parsing tools + run: sudo apt install libxml2-utils + + - name: Install jq + run: sudo apt-get install jq + + - name: Download Geoweaver Artifacts + uses: actions/download-artifact@v2 + with: + name: geoweaver-artifacts + + - name: Get ID and upload URL of the latest release + run: | + RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.PAT }}" "https://api.github.com/repos/${{ github.repository }}/releases/latest") + UPLOAD_URL=$(echo "$RESPONSE" | jq -r .upload_url) + RELEASE_ID=$(echo "$RESPONSE" | jq -r .id) + echo "UPLOAD_URL=$UPLOAD_URL" >> $GITHUB_ENV + echo "RELEASE_ID=$RELEASE_ID" >> $GITHUB_ENV + + - name: Set release title to version + run: | + curl -X PATCH \ + -H "Authorization: token ${{ secrets.PAT }}" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/${{ github.repository }}/releases/${{ env.RELEASE_ID }} \ + -d '{"name": "${{ env.VERSION }}"}' + + - name: Upload JAR Asset + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ env.UPLOAD_URL }} + asset_path: /home/runner/work/geoweaver-deployment-test/geoweaver-deployment-test/target/geoweaver.jar + asset_name: geoweaver.jar + asset_content_type: application/java-archive + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + + - name: Upload DEB Asset + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ env.UPLOAD_URL }} + asset_path: /home/runner/work/geoweaver-deployment-test/geoweaver-deployment-test/linux-deployment/geoweaver.deb + asset_name: geoweaver.deb + asset_content_type: application/vnd.debian.binary-package + env: + GITHUB_TOKEN: ${{ secrets.PAT }} diff --git a/linux-deployment/DEBIAN/control b/linux-deployment/DEBIAN/control new file mode 100644 index 000000000..eee0f2b26 --- /dev/null +++ b/linux-deployment/DEBIAN/control @@ -0,0 +1,5 @@ +Package: geoweaver +Architecture: all +Maintainer: Geoweaver team +Description: Geoweaver +Depends: openjdk-11-jre \ No newline at end of file diff --git a/linux-deployment/DEBIAN/postinst b/linux-deployment/DEBIAN/postinst new file mode 100755 index 000000000..3ee00871e --- /dev/null +++ b/linux-deployment/DEBIAN/postinst @@ -0,0 +1,4 @@ +#!/bin/sh +set -e +update-desktop-database + diff --git a/linux-deployment/usr/local/bin/geoweaver.png b/linux-deployment/usr/local/bin/geoweaver.png new file mode 100644 index 000000000..d1b7119b5 Binary files /dev/null and b/linux-deployment/usr/local/bin/geoweaver.png differ diff --git a/linux-deployment/usr/local/bin/geoweaver.sh b/linux-deployment/usr/local/bin/geoweaver.sh new file mode 100755 index 000000000..29cd77b82 --- /dev/null +++ b/linux-deployment/usr/local/bin/geoweaver.sh @@ -0,0 +1,12 @@ +#!/bin/bash +java -jar /usr/local/bin/geoweaver.jar & +SERVER_PID=$! + +# Wait for the server to start (adjust the time as needed) +sleep 7 + +# Open the URL in the default web browser +xdg-open http://localhost:8070/Geoweaver + +# Wait for the server to complete before exiting +wait $SERVER_PID diff --git a/linux-deployment/usr/share/applications/geoweaver.desktop b/linux-deployment/usr/share/applications/geoweaver.desktop new file mode 100755 index 000000000..11df09bfb --- /dev/null +++ b/linux-deployment/usr/share/applications/geoweaver.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Geoweaver +Comment=Geoweaver Application +Exec=/usr/local/bin/geoweaver.sh +Icon=/usr/local/bin/geoweaver.png +Terminal=false +Type=Application +Categories=Utility; + diff --git a/pom.xml b/pom.xml index 70bdb40e7..8a4dda258 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ com.gw geoweaver - 1.2.1 + 1.2.2 geoweaver A lightweight workflow management software for organizing data analysis workflows, preserving history of every workflow run, and improving scientist producitvity and workflow FAIRness, diff --git a/src/main/resources/static/js/gw.js b/src/main/resources/static/js/gw.js index 50e436120..776c8b568 100644 --- a/src/main/resources/static/js/gw.js +++ b/src/main/resources/static/js/gw.js @@ -9,7 +9,7 @@ edu = { sponsor: "ESIPLab incubator project, NASA ACCESS project, NSF Geoinformatics project, NSF Cybertraining project", - version: "1.2.1", + version: "1.2.2", author: "open source contributors",