From 34b8b8bf4bfaaa98bd7aad90e4a7d99f1bb75766 Mon Sep 17 00:00:00 2001 From: Gokul A Date: Thu, 19 Oct 2023 20:09:04 -0400 Subject: [PATCH 1/7] empty commit From 53656167eb2f8aac96042494bb3c1b256839f16c Mon Sep 17 00:00:00 2001 From: Gokul A Date: Thu, 19 Oct 2023 20:11:03 -0400 Subject: [PATCH 2/7] added GitHub actions to auto deploy jar --- .github/workflows/main.yml | 95 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..b948e5987 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,95 @@ +name: Build and Publish Geoweaver App + +on: + push: + 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: Upload Geoweaver Artifacts + uses: actions/upload-artifact@v2 + with: + name: geoweaver-artifacts + path: | + target/*.jar + pom.xml + + release: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Install XML parsing tools + run: sudo apt install libxml2-utils + + - name: Download Geoweaver Artifacts + uses: actions/download-artifact@v2 + with: + name: geoweaver-artifacts + + - name: List All Files in Workspace + run: | + find "$GITHUB_WORKSPACE" -type f + shell: bash + + - name: Extract Commit Message + run: echo "COMMIT_MESSAGE=$(git log --format=%B -n 1 ${{ github.sha }})" >> $GITHUB_ENV + + - name: Determine Tag Name + id: determine_tag_name + run: | + if [[ -n "${{ github.ref }}" && "${{ github.ref }}" == refs/tags/* ]]; then + echo "TAG_NAME=$(echo "${{ github.ref }}" | sed 's@refs/tags/@@')" >> $GITHUB_ENV + else + echo "TAG_NAME=latest" >> $GITHUB_ENV + fi + shell: bash + + - name: Extract version from pom.xml + run: | + # Assuming pom.xml is in the root directory of your downloaded artifacts + VERSION=$(xmllint --xpath "/*[local-name()='project']/*[local-name()='version']/text()" $GITHUB_WORKSPACE/pom.xml) + echo "VERSION=$VERSION" >> $GITHUB_ENV + + - name: Set Release Name + id: set_release_name + run: echo "RELEASE_NAME=$VERSION" >> $GITHUB_ENV + + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + with: + tag_name: ${{ env.TAG_NAME }} + release_name: ${{ env.RELEASE_NAME }} + body: ${{ env.COMMIT_MESSAGE }} + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + + - name: Upload JAR Asset + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.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 }} \ No newline at end of file From 2e12fd0b970b1d1458c5b56cb810a4857ac7ad1b Mon Sep 17 00:00:00 2001 From: Gokul Prathin <45752727+gokulprathin8@users.noreply.github.com> Date: Sun, 22 Oct 2023 03:46:00 -0400 Subject: [PATCH 3/7] Github Action triggers when a manual relase is made --- .github/workflows/main.yml | 60 ++++++++++++++------------------------ 1 file changed, 22 insertions(+), 38 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b948e5987..f0311837c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,11 +1,11 @@ name: Build and Publish Geoweaver App on: - push: + release: + types: + - published tags: - '*' - workflow_dispatch: - jobs: build: runs-on: ubuntu-latest @@ -39,57 +39,41 @@ jobs: - 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: List All Files in Workspace - run: | - find "$GITHUB_WORKSPACE" -type f - shell: bash - - - name: Extract Commit Message - run: echo "COMMIT_MESSAGE=$(git log --format=%B -n 1 ${{ github.sha }})" >> $GITHUB_ENV - - - name: Determine Tag Name - id: determine_tag_name - run: | - if [[ -n "${{ github.ref }}" && "${{ github.ref }}" == refs/tags/* ]]; then - echo "TAG_NAME=$(echo "${{ github.ref }}" | sed 's@refs/tags/@@')" >> $GITHUB_ENV - else - echo "TAG_NAME=latest" >> $GITHUB_ENV - fi - shell: bash - - name: Extract version from pom.xml run: | - # Assuming pom.xml is in the root directory of your downloaded artifacts VERSION=$(xmllint --xpath "/*[local-name()='project']/*[local-name()='version']/text()" $GITHUB_WORKSPACE/pom.xml) echo "VERSION=$VERSION" >> $GITHUB_ENV - - name: Set Release Name - id: set_release_name - run: echo "RELEASE_NAME=$VERSION" >> $GITHUB_ENV + - 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: Create GitHub Release - id: create_release - uses: actions/create-release@v1 - with: - tag_name: ${{ env.TAG_NAME }} - release_name: ${{ env.RELEASE_NAME }} - body: ${{ env.COMMIT_MESSAGE }} - draft: false - prerelease: false - env: - GITHUB_TOKEN: ${{ secrets.PAT }} + - 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: ${{ steps.create_release.outputs.upload_url }} + 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 }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.PAT }} From 109aa98d488cf2eba9a1fc3ae5e5da9b3d0a896d Mon Sep 17 00:00:00 2001 From: Gokul Prathin <45752727+gokulprathin8@users.noreply.github.com> Date: Sun, 22 Oct 2023 05:52:01 -0400 Subject: [PATCH 4/7] Added deb file build --- .github/workflows/main.yml | 44 +++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f0311837c..0fc3336ac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,6 +6,8 @@ on: - published tags: - '*' + workflow_dispatch: + jobs: build: runs-on: ubuntu-latest @@ -23,6 +25,32 @@ jobs: - 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: @@ -30,6 +58,7 @@ jobs: path: | target/*.jar pom.xml + linux-deployment/*.deb release: needs: build @@ -47,11 +76,6 @@ jobs: with: name: geoweaver-artifacts - - 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: 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") @@ -77,3 +101,13 @@ jobs: 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 }} From 299c2115333b948d58bf3d6107e6012993922351 Mon Sep 17 00:00:00 2001 From: Gokul A Date: Sun, 22 Oct 2023 05:53:55 -0400 Subject: [PATCH 5/7] added support linux build files. --- linux-deployment/DEBIAN/control | 5 +++++ linux-deployment/DEBIAN/postinst | 4 ++++ linux-deployment/usr/local/bin/geoweaver.png | Bin 0 -> 3511 bytes linux-deployment/usr/local/bin/geoweaver.sh | 12 ++++++++++++ .../usr/share/applications/geoweaver.desktop | 9 +++++++++ src/main/java/com/gw/GeoweaverApplication.java | 2 +- 6 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 linux-deployment/DEBIAN/control create mode 100755 linux-deployment/DEBIAN/postinst create mode 100644 linux-deployment/usr/local/bin/geoweaver.png create mode 100755 linux-deployment/usr/local/bin/geoweaver.sh create mode 100755 linux-deployment/usr/share/applications/geoweaver.desktop 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 0000000000000000000000000000000000000000..d1b7119b569fc55d2112c05b458ef70b819fef3b GIT binary patch literal 3511 zcmeHJ_fyl^7XN~VVi2T8LobTT1`@)GgeIL}=&&M4aS26`pc1M^ARxU90#ZUJfGD8! zBC!P7um}Rui-HJfAe0D1ke9bRJ8#|(Z~uTdd*+^d?kS(SbI;s6pBrywVRG~c^aua| zN71H+Hf+mc>n6`3_MD^ry@zcMd+C|$0YH5!c<(BR?aR2E+L!}C*eL*ri2k!aVhI2O z;Q+AW1^}oW0D#=cZ?o0{0M02ZjGYl1gA8l_XZ+KF|FaGp92^+$VWipjdjoG{VGHmm zvR{VsQO<__9%tS&`UY@;6ECI_xRFoyq|}#oob1-`9{kQ0csXv8U|lhPE9i^#cJT+14iwcP z`&`^F=`fcZuRL+Bu-ZPff~-+_NPfxf$g4$Het!6hl4xmbQF(NTeR_^xFPa!`KC16p zWjnk#OfLrj09g3n$^ksgKh6$v%n4Vp3F6k!@`1=0t@-YJ+tIOQalP48Dk#1ZkCMA$LnKJPdu9p38)kprXHr?9MjqAE1}%Lr zTsbOGmp5}EB;~{4VMuCd#LVt^c`&*ud&b_SZKAe4 znUR@o7r*RtM__V6`*xMh&`9@8g7!uU!LE0?8agt{ANu^T{oS^Sa6m&VP-gt=_41l1 zE@4_MpS@q1fP7g^q{@Beoe$~N1zXrGHDkNV`>9Dq`IpOliTuyLl{v_TOq`yGPYyCi z#GH#ly(byERGnY%ptdfWN?Yd3bQ%W>{m{Nh4gcWOL_2y89z>)J~&*=Xn}NIb>?` z+U^mCo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za}?WT-bW@>(kp!SYVhc_p4l``Y&yDqPP6SR#5(1Np(}j7JCH!3p3z*^jN$N`YwI$- z;BPHVKE&Q&a*NL4W*{M@qAfXXK5(6#3rWY7#FmYBPm8TX2?tl|R7y$4FSWHX8XLA$8&fPGd@hv>-8RJtTL}gxOr6qo5y>;iwJu ztre8m5*m|MGWyi4mKRYVBED5k;$AY#98+jtQCn;kmxp`X1u_f`RRq(w-_gZYuSbvQ zoJY%xGORL59->`K71jok*ODtmBz#oG{M)B{-5Foi3F$XSR-_Rp2*zGa8o>XTxW*p< zPl8v>o!2~=>_5&)ypaPQdlm12a=+!lHh?Nz6$yi@!r&Tq2qX%DK*80N;BXWi?n$3{ e^Irfzf9y5S(Ekm9)Oq6B003=dVfa|zjrcDBwvEyN literal 0 HcmV?d00001 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/src/main/java/com/gw/GeoweaverApplication.java b/src/main/java/com/gw/GeoweaverApplication.java index b11e1b623..1f84eda70 100644 --- a/src/main/java/com/gw/GeoweaverApplication.java +++ b/src/main/java/com/gw/GeoweaverApplication.java @@ -73,7 +73,7 @@ public static void main(String[] args) { } - @Bean +@Bean public Docket geoweaverAPI() { return new Docket(DocumentationType.SWAGGER_2) .select() From 8cf654dec6e2d93d58d904f422e9c7df68f5d3f4 Mon Sep 17 00:00:00 2001 From: Gokul A Date: Sun, 22 Oct 2023 05:54:30 -0400 Subject: [PATCH 6/7] revert --- src/main/java/com/gw/GeoweaverApplication.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gw/GeoweaverApplication.java b/src/main/java/com/gw/GeoweaverApplication.java index 1f84eda70..b11e1b623 100644 --- a/src/main/java/com/gw/GeoweaverApplication.java +++ b/src/main/java/com/gw/GeoweaverApplication.java @@ -73,7 +73,7 @@ public static void main(String[] args) { } -@Bean + @Bean public Docket geoweaverAPI() { return new Docket(DocumentationType.SWAGGER_2) .select() From 8ecd9c8807f9b763ca82425126ae5dab9aad8199 Mon Sep 17 00:00:00 2001 From: Ziheng Sun Date: Mon, 23 Oct 2023 08:34:04 -0700 Subject: [PATCH 7/7] bump to enable auto release --- pom.xml | 2 +- src/main/resources/static/js/gw.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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",