From 582748c4a5afb3dafbaf410592637e399af21d52 Mon Sep 17 00:00:00 2001 From: Amiya kumar Sahoo Date: Tue, 20 Dec 2022 14:55:10 +0530 Subject: [PATCH 01/34] groovy 3 compatibility changes done and deploymentPolicyObjectVariables property usage is made non-mandatory --- build.xml | 4 ++-- deploy.ant.xml | 4 ++-- src/com/ibm/dcm/Soma.java | 4 ++-- src/dcm-taskdefs.ant.xml | 4 ++-- .../zip/classes/com/urbancode/air/AirPluginTool.groovy | 8 ++++---- src/main/zip/plugin.xml | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/build.xml b/build.xml index 50a4e1c..f2915f5 100644 --- a/build.xml +++ b/build.xml @@ -41,7 +41,7 @@ - + @@ -50,7 +50,7 @@ - + diff --git a/deploy.ant.xml b/deploy.ant.xml index f64a55b..9f36f1e 100644 --- a/deploy.ant.xml +++ b/deploy.ant.xml @@ -1009,7 +1009,7 @@ - + @@ -1026,7 +1026,7 @@ In case of an error it throws an exception or prints the SOAP response and terminates Ant. --> diff --git a/src/com/ibm/dcm/Soma.java b/src/com/ibm/dcm/Soma.java index 46deab6..946474c 100644 --- a/src/com/ibm/dcm/Soma.java +++ b/src/com/ibm/dcm/Soma.java @@ -3118,8 +3118,8 @@ else if (params.get("local").toLowerCase().endsWith(".zip")) body += " deployment-policy=\"\""; if (params.get("deployment-policy-variables") != null) body += " deployment-policy-variables=\"" + params.get("deployment-policy-variables") + "\""; - else - body += " deployment-policy-variables=\"\""; + // else + // body += " deployment-policy-variables=\"\""; body += ">"; body += "" + Base64.base64FromBinaryFile(params.get("local")) + ""; diff --git a/src/dcm-taskdefs.ant.xml b/src/dcm-taskdefs.ant.xml index 15d798e..4425889 100644 --- a/src/dcm-taskdefs.ant.xml +++ b/src/dcm-taskdefs.ant.xml @@ -1760,7 +1760,7 @@ - + @@ -1786,7 +1786,7 @@ @{domain} @{inputfile} @{dpo} - @{dpov} + @{host} @{port} @{uid} diff --git a/src/main/zip/classes/com/urbancode/air/AirPluginTool.groovy b/src/main/zip/classes/com/urbancode/air/AirPluginTool.groovy index 53a0f89..390fe31 100644 --- a/src/main/zip/classes/com/urbancode/air/AirPluginTool.groovy +++ b/src/main/zip/classes/com/urbancode/air/AirPluginTool.groovy @@ -25,7 +25,7 @@ public class AirPluginTool { // INSTANCE //************************************************************************** - final public def isWindows = (System.getProperty('os.name') =~ /(?i)windows/).find() + public def isWindows = (System.getProperty('os.name') =~ /(?i)windows/).find() def out = System.out; def err = System.err; @@ -43,8 +43,8 @@ public class AirPluginTool { public Properties getStepProperties() { def props = new Properties(); - final def inputPropsFile = this.inPropsFile; - final def inputPropsStream = null; + def inputPropsFile = this.inPropsFile; + def inputPropsStream = null; try { inputPropsStream = new FileInputStream(inputPropsFile); props.load(inputPropsStream); @@ -63,7 +63,7 @@ public class AirPluginTool { } public void setOutputProperties() { - final OutputStream outputPropsStream = null; + OutputStream outputPropsStream = null; try { outputPropsStream = new FileOutputStream(this.outPropsFile); outProps.store(outputPropsStream, ""); diff --git a/src/main/zip/plugin.xml b/src/main/zip/plugin.xml index 4ff4ce0..e6677e4 100644 --- a/src/main/zip/plugin.xml +++ b/src/main/zip/plugin.xml @@ -1240,7 +1240,7 @@ - + From 71f1d34d567dcdeb207b17f539e130e2ecb64365 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Wed, 4 Sep 2024 14:15:45 +0530 Subject: [PATCH 02/34] Update plugin.xml --- src/main/zip/plugin.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/zip/plugin.xml b/src/main/zip/plugin.xml index e6677e4..d4d7f69 100644 --- a/src/main/zip/plugin.xml +++ b/src/main/zip/plugin.xml @@ -19,7 +19,7 @@
- + The IBM WebSphere DataPower plugin deploys DataPower services. Infrastructure/WebSphere DataPower
From e47dbe1645c1891ecf77b27418751db8fc232fe5 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Wed, 4 Sep 2024 14:16:35 +0530 Subject: [PATCH 03/34] Update info.xml --- src/main/zip/info.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/zip/info.xml b/src/main/zip/info.xml index 54b067f..05520db 100644 --- a/src/main/zip/info.xml +++ b/src/main/zip/info.xml @@ -193,5 +193,9 @@ PR #109 - Steps fail with null pointer exception! + + Fixed groovy3 compatibility issue. + Property “Deployment policy object variable name” made optional as some users face issue due to this. + From 2624ccac60d35a706ee82b38855b6e562e37dbbe Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Wed, 4 Sep 2024 14:17:18 +0530 Subject: [PATCH 04/34] Update upgrade.xml --- src/main/zip/upgrade.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/zip/upgrade.xml b/src/main/zip/upgrade.xml index 034ce35..9c24dce 100644 --- a/src/main/zip/upgrade.xml +++ b/src/main/zip/upgrade.xml @@ -593,5 +593,7 @@ + + From 96e1a4aa363321f14d7429e55862f7362978f074 Mon Sep 17 00:00:00 2001 From: amiyakumar-sahoo Date: Thu, 19 Sep 2024 12:26:03 +0530 Subject: [PATCH 05/34] updated to v26 --- src/main/zip/info.xml | 3 ++ src/main/zip/plugin.xml | 81 +++++++++++++++++++++++++++++++++++++++- src/main/zip/upgrade.xml | 2 + 3 files changed, 84 insertions(+), 2 deletions(-) diff --git a/src/main/zip/info.xml b/src/main/zip/info.xml index 05520db..f263576 100644 --- a/src/main/zip/info.xml +++ b/src/main/zip/info.xml @@ -197,5 +197,8 @@ Fixed groovy3 compatibility issue. Property “Deployment policy object variable name” made optional as some users face issue due to this. + + Added "upload directory" step a a duplicate step to "upload files" to avoid confusion for a users. + diff --git a/src/main/zip/plugin.xml b/src/main/zip/plugin.xml index d4d7f69..31147d4 100644 --- a/src/main/zip/plugin.xml +++ b/src/main/zip/plugin.xml @@ -19,7 +19,7 @@
- + The IBM WebSphere DataPower plugin deploys DataPower services. Infrastructure/WebSphere DataPower
@@ -1825,7 +1825,84 @@ - + + Upload directories + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create/overwrite files/directories based on a definition file diff --git a/src/main/zip/upgrade.xml b/src/main/zip/upgrade.xml index 9c24dce..09885b1 100644 --- a/src/main/zip/upgrade.xml +++ b/src/main/zip/upgrade.xml @@ -595,5 +595,7 @@ + + From 6a0d85247e968f93c1e5a4d8ff82574434920e21 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:47:23 +0530 Subject: [PATCH 06/34] Create main.yml --- .github/workflows/main.yml | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 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 0000000..f705b25 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,64 @@ +name: CI + +on: + push: + branches: + - actions # Trigger only when pushing to the 'actions' branch + +jobs: + build: + runs-on: ubuntu-20.04 # Use the Ubuntu 20.04 runner + + strategy: + matrix: + jdk: + - oraclejdk8 + - openjdk7 + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up JDK + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.jdk }} + + - name: Set up Ant + run: | + sudo apt-get install ant + + - name: Build the project + env: + VERSION: ${{ github.ref }}.${{ github.sha }} + run: | + ant -Dplugin.version=${VERSION} + + - name: Archive artifacts + uses: actions/upload-artifact@v2 + with: + name: artifacts + path: | + dist/datapower-v*.zip + dist/dcm.jar + + deploy: + runs-on: ubuntu-20.04 + needs: build + if: github.ref_type == 'tag' # Only deploy on tag push + + steps: + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: artifacts + + - name: Deploy to GitHub Releases + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ github.ref }} + files: | + dist/datapower-v*.zip + dist/dcm.jar + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From fa7dd7019f3069369602682d9ea0e5d84fa6ede3 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:49:31 +0530 Subject: [PATCH 07/34] Update main.yml --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f705b25..e80dc65 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,7 @@ jobs: ant -Dplugin.version=${VERSION} - name: Archive artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Updated to v3 with: name: artifacts path: | @@ -49,7 +49,7 @@ jobs: steps: - name: Download artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 # Updated to v3 with: name: artifacts From 8882401b362eacd3c46c44c63471de65f1a86ea9 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:51:58 +0530 Subject: [PATCH 08/34] Update main.yml --- .github/workflows/main.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e80dc65..5a1bcfe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,17 +12,18 @@ jobs: strategy: matrix: jdk: - - oraclejdk8 - - openjdk7 - + - 8 # Use JDK 8 + - 7 # Use JDK 7 + steps: - name: Checkout code uses: actions/checkout@v2 - name: Set up JDK - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: - java-version: ${{ matrix.jdk }} + distribution: 'temurin' # Use Eclipse Temurin distribution + java-version: ${{ matrix.jdk }} # Set Java version (8 or 7) - name: Set up Ant run: | @@ -35,7 +36,7 @@ jobs: ant -Dplugin.version=${VERSION} - name: Archive artifacts - uses: actions/upload-artifact@v3 # Updated to v3 + uses: actions/upload-artifact@v3 with: name: artifacts path: | @@ -49,7 +50,7 @@ jobs: steps: - name: Download artifacts - uses: actions/download-artifact@v3 # Updated to v3 + uses: actions/download-artifact@v3 with: name: artifacts From bb9e36cf8639edccbab71bdbf6334bc5e10e3a74 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:55:02 +0530 Subject: [PATCH 09/34] Update main.yml --- .github/workflows/main.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5a1bcfe..9d6280b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,9 +25,13 @@ jobs: distribution: 'temurin' # Use Eclipse Temurin distribution java-version: ${{ matrix.jdk }} # Set Java version (8 or 7) - - name: Set up Ant - run: | - sudo apt-get install ant + - name: Update system packages + run: sudo apt-get update + + # Remove the Ant installation step because Ant is already installed + + - name: Verify Ant installation (optional) + run: ant -version - name: Build the project env: From 8037ed373dde7e6a264d3b8eb49cc6f94d52b97e Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:57:03 +0530 Subject: [PATCH 10/34] Update main.yml --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9d6280b..ed09be5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,8 +25,6 @@ jobs: distribution: 'temurin' # Use Eclipse Temurin distribution java-version: ${{ matrix.jdk }} # Set Java version (8 or 7) - - name: Update system packages - run: sudo apt-get update # Remove the Ant installation step because Ant is already installed From 19bb96c7b579475a3a8232aef77312a0f1ec6760 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:02:20 +0530 Subject: [PATCH 11/34] Update main.yml --- .github/workflows/main.yml | 56 ++++++++------------------------------ 1 file changed, 11 insertions(+), 45 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ed09be5..14b85e7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,20 +1,7 @@ -name: CI - -on: - push: - branches: - - actions # Trigger only when pushing to the 'actions' branch - jobs: build: - runs-on: ubuntu-20.04 # Use the Ubuntu 20.04 runner + runs-on: ubuntu-20.04 - strategy: - matrix: - jdk: - - 8 # Use JDK 8 - - 7 # Use JDK 7 - steps: - name: Checkout code uses: actions/checkout@v2 @@ -22,21 +9,21 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - distribution: 'temurin' # Use Eclipse Temurin distribution - java-version: ${{ matrix.jdk }} # Set Java version (8 or 7) - + distribution: 'temurin' + java-version: '8' - # Remove the Ant installation step because Ant is already installed - - - name: Verify Ant installation (optional) - run: ant -version + - name: Install Apache Ant 1.9.9 + run: | + wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.9.9-bin.zip + unzip apache-ant-1.9.9-bin.zip + sudo mv apache-ant-1.9.9 /usr/local/ant + export PATH=$PATH:/usr/local/ant/bin - name: Build the project env: VERSION: ${{ github.ref }}.${{ github.sha }} - run: | - ant -Dplugin.version=${VERSION} - + run: ant -Dplugin.version=${VERSION} + - name: Archive artifacts uses: actions/upload-artifact@v3 with: @@ -44,24 +31,3 @@ jobs: path: | dist/datapower-v*.zip dist/dcm.jar - - deploy: - runs-on: ubuntu-20.04 - needs: build - if: github.ref_type == 'tag' # Only deploy on tag push - - steps: - - name: Download artifacts - uses: actions/download-artifact@v3 - with: - name: artifacts - - - name: Deploy to GitHub Releases - uses: softprops/action-gh-release@v1 - with: - tag_name: ${{ github.ref }} - files: | - dist/datapower-v*.zip - dist/dcm.jar - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 5e19cebb394dc3ea958399d98955339e0583c005 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:05:11 +0530 Subject: [PATCH 12/34] Update main.yml --- .github/workflows/main.yml | 62 +++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 14b85e7..502e56d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,15 +1,24 @@ +name: Build DCM Project and Create Release + +on: + push: + branches: + - actions # Triggers on push to the 'actions' branch + tags: + - '*' # Triggers on any tag creation (for release) + jobs: build: runs-on: ubuntu-20.04 - + steps: - name: Checkout code uses: actions/checkout@v2 - - - name: Set up JDK + + - name: Set up JDK 8 uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: 'temurin' # Can be changed to a different JDK distribution java-version: '8' - name: Install Apache Ant 1.9.9 @@ -17,12 +26,18 @@ jobs: wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.9.9-bin.zip unzip apache-ant-1.9.9-bin.zip sudo mv apache-ant-1.9.9 /usr/local/ant - export PATH=$PATH:/usr/local/ant/bin - + echo "export PATH=$PATH:/usr/local/ant/bin" >> $GITHUB_ENV + + - name: Verify Ant installation + run: ant -version + + - name: Set build version + run: echo "VERSION=${GITHUB_REF#refs/tags/}.${GITHUB_SHA:0:7}" >> $GITHUB_ENV + - name: Build the project env: - VERSION: ${{ github.ref }}.${{ github.sha }} - run: ant -Dplugin.version=${VERSION} + VERSION: ${{ env.VERSION }} + run: ant -Dplugin.version=${{ env.VERSION }} - name: Archive artifacts uses: actions/upload-artifact@v3 @@ -31,3 +46,34 @@ jobs: path: | dist/datapower-v*.zip dist/dcm.jar + + release: + runs-on: ubuntu-20.04 + needs: build # Release job depends on successful completion of build job + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Create GitHub release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} # Uses the tag that triggered the workflow + release_name: "Release ${{ github.ref }}" # Give the release a name based on the tag + body: | + Release notes for ${{ github.ref }}. + - Plugin version: ${{ env.VERSION }} + draft: false + prerelease: false + + - name: Upload release assets + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create-release.outputs.upload_url }} + asset_path: dist/datapower-v${{ env.VERSION }}.zip + asset_name: datapower-v${{ env.VERSION }}.zip + asset_content_type: application/zip From 52b396efe2e6e1f112bb8267a9bfb325f114f97d Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:10:21 +0530 Subject: [PATCH 13/34] Update main.yml --- .github/workflows/main.yml | 53 +++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 502e56d..e1a0437 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,33 +47,32 @@ jobs: dist/datapower-v*.zip dist/dcm.jar - release: - runs-on: ubuntu-20.04 - needs: build # Release job depends on successful completion of build job +release: + runs-on: ubuntu-20.04 + needs: build - steps: - - name: Checkout code - uses: actions/checkout@v2 + steps: + - name: Checkout code + uses: actions/checkout@v2 - - name: Create GitHub release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} # Uses the tag that triggered the workflow - release_name: "Release ${{ github.ref }}" # Give the release a name based on the tag - body: | - Release notes for ${{ github.ref }}. - - Plugin version: ${{ env.VERSION }} - draft: false - prerelease: false + - name: Create GitHub release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref_name }} # Use the tag name directly + release_name: "Release ${{ github.ref_name }}" # Use the tag name for the release + body: | + Release notes for ${{ github.ref_name }}. + - Plugin version: ${{ env.VERSION }} + draft: false + prerelease: false - - name: Upload release assets - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create-release.outputs.upload_url }} - asset_path: dist/datapower-v${{ env.VERSION }}.zip - asset_name: datapower-v${{ env.VERSION }}.zip - asset_content_type: application/zip + - name: Upload release assets + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create-release.outputs.upload_url }} + asset_path: dist/datapower-v${{ env.VERSION }}.zip + asset From fb09236165e035278f4b337c7ae16c2158882e4b Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:11:52 +0530 Subject: [PATCH 14/34] Update main.yml --- .github/workflows/main.yml | 57 +++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e1a0437..3ebb436 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: - name: Set up JDK 8 uses: actions/setup-java@v3 with: - distribution: 'temurin' # Can be changed to a different JDK distribution + distribution: 'temurin' # You can change this to another JDK distribution if needed java-version: '8' - name: Install Apache Ant 1.9.9 @@ -26,7 +26,7 @@ jobs: wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.9.9-bin.zip unzip apache-ant-1.9.9-bin.zip sudo mv apache-ant-1.9.9 /usr/local/ant - echo "export PATH=$PATH:/usr/local/ant/bin" >> $GITHUB_ENV + echo "export PATH=\$PATH:/usr/local/ant/bin" >> $GITHUB_ENV - name: Verify Ant installation run: ant -version @@ -47,32 +47,33 @@ jobs: dist/datapower-v*.zip dist/dcm.jar -release: - runs-on: ubuntu-20.04 - needs: build + release: + runs-on: ubuntu-20.04 + needs: build # Release job depends on successful completion of build job - steps: - - name: Checkout code - uses: actions/checkout@v2 + steps: + - name: Checkout code + uses: actions/checkout@v2 - - name: Create GitHub release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref_name }} # Use the tag name directly - release_name: "Release ${{ github.ref_name }}" # Use the tag name for the release - body: | - Release notes for ${{ github.ref_name }}. - - Plugin version: ${{ env.VERSION }} - draft: false - prerelease: false + - name: Create GitHub release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref_name }} # Use the tag name directly + release_name: "Release ${{ github.ref_name }}" # Use the tag name for the release + body: | + Release notes for ${{ github.ref_name }}. + - Plugin version: ${{ env.VERSION }} + draft: false + prerelease: false - - name: Upload release assets - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create-release.outputs.upload_url }} - asset_path: dist/datapower-v${{ env.VERSION }}.zip - asset + - name: Upload release assets + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create-release.outputs.upload_url }} + asset_path: dist/datapower-v${{ env.VERSION }}.zip + asset_name: datapower-v${{ env.VERSION }}.zip + asset_content_type: application/zip From 99efeb3f64bdc6235e340b5d39d958d7f14e2991 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:20:13 +0530 Subject: [PATCH 15/34] Update main.yml --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3ebb436..d0beae0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,6 +56,7 @@ jobs: uses: actions/checkout@v2 - name: Create GitHub release + id: create_release # Add an ID to this step uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -73,7 +74,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.create-release.outputs.upload_url }} + upload_url: ${{ steps.create_release.outputs.upload_url }} # Reference the output from create_release step asset_path: dist/datapower-v${{ env.VERSION }}.zip asset_name: datapower-v${{ env.VERSION }}.zip asset_content_type: application/zip From f67691fba092562bf151d53f733b669486bf4065 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:27:33 +0530 Subject: [PATCH 16/34] Update main.yml --- .github/workflows/main.yml | 59 ++++++++++++++------------------------ 1 file changed, 21 insertions(+), 38 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d0beae0..18e6583 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,11 +1,9 @@ -name: Build DCM Project and Create Release +name: CI on: push: branches: - - actions # Triggers on push to the 'actions' branch - tags: - - '*' # Triggers on any tag creation (for release) + - actions # This workflow will be triggered only for pushes to the "actions" branch jobs: build: @@ -15,57 +13,42 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Set up JDK 8 - uses: actions/setup-java@v3 + - name: Set up Java + uses: actions/setup-java@v2 with: - distribution: 'temurin' # You can change this to another JDK distribution if needed - java-version: '8' + java-version: '8' # Use the appropriate JDK version - - name: Install Apache Ant 1.9.9 - run: | - wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.9.9-bin.zip - unzip apache-ant-1.9.9-bin.zip - sudo mv apache-ant-1.9.9 /usr/local/ant - echo "export PATH=\$PATH:/usr/local/ant/bin" >> $GITHUB_ENV - - - name: Verify Ant installation - run: ant -version - - - name: Set build version - run: echo "VERSION=${GITHUB_REF#refs/tags/}.${GITHUB_SHA:0:7}" >> $GITHUB_ENV + - name: Install Ant + run: sudo apt-get install -y ant - name: Build the project - env: - VERSION: ${{ env.VERSION }} - run: ant -Dplugin.version=${{ env.VERSION }} + run: ant -Dplugin.version=${{ github.sha }} - name: Archive artifacts - uses: actions/upload-artifact@v3 - with: - name: artifacts - path: | - dist/datapower-v*.zip - dist/dcm.jar + run: | + mkdir -p dist + cp dist/datapower-v*.zip dist/ + cp dist/dcm.jar dist/ release: runs-on: ubuntu-20.04 - needs: build # Release job depends on successful completion of build job + needs: build # Release job depends on successful completion of the build job steps: - name: Checkout code uses: actions/checkout@v2 - name: Create GitHub release - id: create_release # Add an ID to this step + id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ github.ref_name }} # Use the tag name directly - release_name: "Release ${{ github.ref_name }}" # Use the tag name for the release + tag_name: "actions-${{ github.sha }}" # Tag name format + release_name: "Plugin version: ${{ github.sha }}" # Release name format body: | - Release notes for ${{ github.ref_name }}. - - Plugin version: ${{ env.VERSION }} + Release notes for actions-${{ github.sha }}. + - Plugin version: ${{ github.sha }} draft: false prerelease: false @@ -74,7 +57,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # Reference the output from create_release step - asset_path: dist/datapower-v${{ env.VERSION }}.zip - asset_name: datapower-v${{ env.VERSION }}.zip + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: dist/datapower-v*.zip # Path to your zip file + asset_name: datapower-v.zip # Name of the asset asset_content_type: application/zip From f851d1466c02382ea45c47aa4fc7a084aa009e69 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:28:30 +0530 Subject: [PATCH 17/34] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 18e6583..19248d7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Java - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: java-version: '8' # Use the appropriate JDK version From 3404552887c4cb8b5ba783d04968da3d11fbb393 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:29:47 +0530 Subject: [PATCH 18/34] Update main.yml --- .github/workflows/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 19248d7..c399692 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: CI on: push: branches: - - actions # This workflow will be triggered only for pushes to the "actions" branch + - actions # Trigger on pushes to the "actions" branch jobs: build: @@ -16,7 +16,8 @@ jobs: - name: Set up Java uses: actions/setup-java@v3 with: - java-version: '8' # Use the appropriate JDK version + java-version: '8' # JDK version + distribution: 'adopt' # Set the Java distribution - name: Install Ant run: sudo apt-get install -y ant From b8f1e326d82e93e9aedf486a40f5ffa8278d6e43 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:32:23 +0530 Subject: [PATCH 19/34] Update main.yml --- .github/workflows/main.yml | 39 ++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c399692..84b8887 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,9 +1,11 @@ -name: CI +name: Build DCM Project and Create Release on: push: branches: - - actions # Trigger on pushes to the "actions" branch + - actions # Triggers on push to the 'actions' branch + tags: + - '*' # Triggers on any tag creation (for release) jobs: build: @@ -13,23 +15,36 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Set up Java + - name: Set up JDK 8 uses: actions/setup-java@v3 with: - java-version: '8' # JDK version - distribution: 'adopt' # Set the Java distribution + distribution: 'temurin' # You can change this to another JDK distribution if needed + java-version: '8' - - name: Install Ant - run: sudo apt-get install -y ant + - name: Install Apache Ant 1.9.9 + run: | + wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.9.9-bin.zip + unzip apache-ant-1.9.9-bin.zip + sudo mv apache-ant-1.9.9 /usr/local/ant + echo "export PATH=\$PATH:/usr/local/ant/bin" >> $GITHUB_ENV + - name: Verify Ant installation + run: ant -version + + - name: Set build version + run: echo "VERSION=${GITHUB_REF#refs/tags/}.${GITHUB_SHA:0:7}" >> $GITHUB_ENV - name: Build the project - run: ant -Dplugin.version=${{ github.sha }} + env: + VERSION: ${{ env.VERSION }} + run: ant -Dplugin.version=${{ env.VERSION }} - name: Archive artifacts - run: | - mkdir -p dist - cp dist/datapower-v*.zip dist/ - cp dist/dcm.jar dist/ + uses: actions/upload-artifact@v3 + with: + name: artifacts + path: | + dist/datapower-v*.zip + dist/dcm.jar release: runs-on: ubuntu-20.04 From 48f7f0be8faff03d1fa8133ce5691c102546333d Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:44:33 +0530 Subject: [PATCH 20/34] Update main.yml --- .github/workflows/main.yml | 51 ++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 84b8887..1f62470 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,11 +1,9 @@ -name: Build DCM Project and Create Release +name: CI on: push: branches: - - actions # Triggers on push to the 'actions' branch - tags: - - '*' # Triggers on any tag creation (for release) + - actions # Trigger this workflow on pushes to the "actions" branch jobs: build: @@ -15,40 +13,33 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Set up JDK 8 + - name: Set up Java uses: actions/setup-java@v3 with: - distribution: 'temurin' # You can change this to another JDK distribution if needed - java-version: '8' + java-version: '8' # Use the appropriate JDK version + distribution: 'adopt' # Set the Java distribution - - name: Install Apache Ant 1.9.9 - run: | - wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.9.9-bin.zip - unzip apache-ant-1.9.9-bin.zip - sudo mv apache-ant-1.9.9 /usr/local/ant - echo "export PATH=\$PATH:/usr/local/ant/bin" >> $GITHUB_ENV - - name: Verify Ant installation - run: ant -version - - - name: Set build version - run: echo "VERSION=${GITHUB_REF#refs/tags/}.${GITHUB_SHA:0:7}" >> $GITHUB_ENV + - name: Install Ant + run: sudo apt-get install -y ant - name: Build the project - env: - VERSION: ${{ env.VERSION }} - run: ant -Dplugin.version=${{ env.VERSION }} + run: ant -Dskip.chkpii=y # Run the specified Ant command - name: Archive artifacts - uses: actions/upload-artifact@v3 - with: - name: artifacts - path: | - dist/datapower-v*.zip - dist/dcm.jar + run: | + mkdir -p dist + cp dist/datapower-v*.zip dist/ + cp dist/dcm.jar dist/ + + - name: Extract Plugin Version + id: extract_version + run: | + PLUGIN_VERSION=$(grep -oPm1 "(?<=)[^<]+" src/main/plugin.xml) + echo "PLUGIN_VERSION=${PLUGIN_VERSION}" >> $GITHUB_ENV release: runs-on: ubuntu-20.04 - needs: build # Release job depends on successful completion of the build job + needs: build # Release job depends on the successful completion of the build job steps: - name: Checkout code @@ -61,10 +52,10 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: "actions-${{ github.sha }}" # Tag name format - release_name: "Plugin version: ${{ github.sha }}" # Release name format + release_name: "Plugin version: ${{ env.PLUGIN_VERSION }}" # Release name format body: | Release notes for actions-${{ github.sha }}. - - Plugin version: ${{ github.sha }} + - Plugin version: ${{ env.PLUGIN_VERSION }} draft: false prerelease: false From ca936ecf2fd0f5ebacd56641a4a7c7007d2088cd Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:51:59 +0530 Subject: [PATCH 21/34] Update main.yml --- .github/workflows/main.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1f62470..2de4316 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,8 +28,13 @@ jobs: - name: Archive artifacts run: | mkdir -p dist - cp dist/datapower-v*.zip dist/ - cp dist/dcm.jar dist/ + # Check if the file exists before copying + if [ -f dist/datapower-v*.zip ]; then + cp dist/datapower-v*.zip dist/ + fi + if [ -f dist/dcm.jar ]; then + cp dist/dcm.jar dist/ + fi - name: Extract Plugin Version id: extract_version From 1e368ca08c6c572853c63f1ff353817743243239 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:53:30 +0530 Subject: [PATCH 22/34] Update main.yml --- .github/workflows/main.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2de4316..694d392 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,17 +25,6 @@ jobs: - name: Build the project run: ant -Dskip.chkpii=y # Run the specified Ant command - - name: Archive artifacts - run: | - mkdir -p dist - # Check if the file exists before copying - if [ -f dist/datapower-v*.zip ]; then - cp dist/datapower-v*.zip dist/ - fi - if [ -f dist/dcm.jar ]; then - cp dist/dcm.jar dist/ - fi - - name: Extract Plugin Version id: extract_version run: | From 8df82442a64cde0ce442c343a44d881262402882 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:56:21 +0530 Subject: [PATCH 23/34] Update main.yml --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 694d392..1c9d1e1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,12 +25,12 @@ jobs: - name: Build the project run: ant -Dskip.chkpii=y # Run the specified Ant command - - name: Extract Plugin Version + - name: Extract Plugin Version from ZIP id: extract_version run: | - PLUGIN_VERSION=$(grep -oPm1 "(?<=)[^<]+" src/main/plugin.xml) - echo "PLUGIN_VERSION=${PLUGIN_VERSION}" >> $GITHUB_ENV - + # Unzip the plugin ZIP file to a temporary directory + unzip dist/datapower-v*.zip -d temp_dir + release: runs-on: ubuntu-20.04 needs: build # Release job depends on the successful completion of the build job From 40422ee89fda0c0cc486a307ffd808b9482a7255 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:01:21 +0530 Subject: [PATCH 24/34] Update main.yml --- .github/workflows/main.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1c9d1e1..05dbae0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,7 +6,7 @@ on: - actions # Trigger this workflow on pushes to the "actions" branch jobs: - build: + build_and_release: runs-on: ubuntu-20.04 steps: @@ -25,19 +25,17 @@ jobs: - name: Build the project run: ant -Dskip.chkpii=y # Run the specified Ant command + - name: List files in dist directory + run: ls -l dist # Debugging step to list files + - name: Extract Plugin Version from ZIP id: extract_version run: | # Unzip the plugin ZIP file to a temporary directory unzip dist/datapower-v*.zip -d temp_dir - - release: - runs-on: ubuntu-20.04 - needs: build # Release job depends on the successful completion of the build job - - steps: - - name: Checkout code - uses: actions/checkout@v2 + # Extract version from the filename or content + VERSION=$(basename dist/datapower-v*.zip | sed 's/datapower-v-\(.*\)\.zip/\1/') + echo "PLUGIN_VERSION=$VERSION" >> $GITHUB_ENV # Set the version as an environment variable - name: Create GitHub release id: create_release @@ -59,6 +57,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: dist/datapower-v*.zip # Path to your zip file + asset_path: dist/datapower-v-${{ env.PLUGIN_VERSION }}.zip # Use the versioned file asset_name: datapower-v.zip # Name of the asset asset_content_type: application/zip From aee2e5de9fbc9a146e661a5c210342e94a954314 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:06:08 +0530 Subject: [PATCH 25/34] Update main.yml --- .github/workflows/main.yml | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 05dbae0..88c3525 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,15 +28,6 @@ jobs: - name: List files in dist directory run: ls -l dist # Debugging step to list files - - name: Extract Plugin Version from ZIP - id: extract_version - run: | - # Unzip the plugin ZIP file to a temporary directory - unzip dist/datapower-v*.zip -d temp_dir - # Extract version from the filename or content - VERSION=$(basename dist/datapower-v*.zip | sed 's/datapower-v-\(.*\)\.zip/\1/') - echo "PLUGIN_VERSION=$VERSION" >> $GITHUB_ENV # Set the version as an environment variable - - name: Create GitHub release id: create_release uses: actions/create-release@v1 @@ -44,19 +35,21 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: "actions-${{ github.sha }}" # Tag name format - release_name: "Plugin version: ${{ env.PLUGIN_VERSION }}" # Release name format + release_name: "Release for actions-${{ github.sha }}" # Release name format body: | Release notes for actions-${{ github.sha }}. - - Plugin version: ${{ env.PLUGIN_VERSION }} draft: false prerelease: false - name: Upload release assets - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: dist/datapower-v-${{ env.PLUGIN_VERSION }}.zip # Use the versioned file - asset_name: datapower-v.zip # Name of the asset - asset_content_type: application/zip + run: | + for file in dist/*.zip; do + if [ -f "$file" ]; then + echo "Uploading $file" + curl -X POST \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Content-Type: application/zip" \ + --data-binary @"$file" \ + "${{ steps.create_release.outputs.upload_url }}&name=$(basename "$file")" + fi + done From 39448fa4c27ef229f1c89439774d3b9dac8b685b Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:09:13 +0530 Subject: [PATCH 26/34] Update main.yml --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 88c3525..97e73e3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,6 +50,7 @@ jobs: -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Content-Type: application/zip" \ --data-binary @"$file" \ - "${{ steps.create_release.outputs.upload_url }}&name=$(basename "$file")" + "${{ steps.create_release.outputs.upload_url }}&name=$(basename "$file")" \ + || echo "Failed to upload $file" # Added error handling fi done From cba3b3e2cb519d587a4fe2f57a2b4ec2b5a0bbd7 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:13:01 +0530 Subject: [PATCH 27/34] Update main.yml --- .github/workflows/main.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 97e73e3..5d41c25 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,7 +50,11 @@ jobs: -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Content-Type: application/zip" \ --data-binary @"$file" \ - "${{ steps.create_release.outputs.upload_url }}&name=$(basename "$file")" \ - || echo "Failed to upload $file" # Added error handling + "${{ steps.create_release.outputs.upload_url }}&name=$(basename "$file")" + + # Check if upload was successful + if [ $? -ne 0 ]; then + echo "Failed to upload $file" + fi fi done From 2b095b854ec1ceee9e92e8aa791cc789a8d1d693 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:20:41 +0530 Subject: [PATCH 28/34] Update main.yml --- .github/workflows/main.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5d41c25..96a73df 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,18 +43,17 @@ jobs: - name: Upload release assets run: | - for file in dist/*.zip; do + echo "Listing files in the dist directory:" + ls -l dist # List files to be uploaded + + # Loop through each ZIP and JAR file in the dist directory and upload them + for file in dist/*.{zip,jar}; do if [ -f "$file" ]; then echo "Uploading $file" curl -X POST \ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -H "Content-Type: application/zip" \ + -H "Content-Type: application/octet-stream" \ --data-binary @"$file" \ - "${{ steps.create_release.outputs.upload_url }}&name=$(basename "$file")" - - # Check if upload was successful - if [ $? -ne 0 ]; then - echo "Failed to upload $file" - fi + "${{ steps.create_release.outputs.upload_url }}?name=$(basename "$file")" || echo "Failed to upload $file" fi done From daa7848bbc4899101473b5397741dae922d6c7f5 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:23:11 +0530 Subject: [PATCH 29/34] Update main.yml --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 96a73df..a18f2c8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,10 +50,12 @@ jobs: for file in dist/*.{zip,jar}; do if [ -f "$file" ]; then echo "Uploading $file" + # Correct the upload URL formatting + upload_url="${{ steps.create_release.outputs.upload_url }}?name=$(basename "$file")" curl -X POST \ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Content-Type: application/octet-stream" \ --data-binary @"$file" \ - "${{ steps.create_release.outputs.upload_url }}?name=$(basename "$file")" || echo "Failed to upload $file" + "$upload_url" || echo "Failed to upload $file" fi done From e7b62645ef9df95171c2ed622217cd32ae022e15 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:25:15 +0530 Subject: [PATCH 30/34] Update main.yml --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a18f2c8..95fede3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,8 +50,10 @@ jobs: for file in dist/*.{zip,jar}; do if [ -f "$file" ]; then echo "Uploading $file" - # Correct the upload URL formatting + # Correctly format the upload URL upload_url="${{ steps.create_release.outputs.upload_url }}?name=$(basename "$file")" + + # Upload the file using curl curl -X POST \ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Content-Type: application/octet-stream" \ From e4f42bb6f4728bfaabf4ec11abef174615c7bdcc Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:40:17 +0530 Subject: [PATCH 31/34] Update main.yml --- .github/workflows/main.yml | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 95fede3..8f63725 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,36 +28,10 @@ jobs: - name: List files in dist directory run: ls -l dist # Debugging step to list files - - name: Create GitHub release - id: create_release - uses: actions/create-release@v1 + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + tag_name: myTag + files: "dist/*.zip" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: "actions-${{ github.sha }}" # Tag name format - release_name: "Release for actions-${{ github.sha }}" # Release name format - body: | - Release notes for actions-${{ github.sha }}. - draft: false - prerelease: false - - - name: Upload release assets - run: | - echo "Listing files in the dist directory:" - ls -l dist # List files to be uploaded - - # Loop through each ZIP and JAR file in the dist directory and upload them - for file in dist/*.{zip,jar}; do - if [ -f "$file" ]; then - echo "Uploading $file" - # Correctly format the upload URL - upload_url="${{ steps.create_release.outputs.upload_url }}?name=$(basename "$file")" - - # Upload the file using curl - curl -X POST \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -H "Content-Type: application/octet-stream" \ - --data-binary @"$file" \ - "$upload_url" || echo "Failed to upload $file" - fi - done From 860ac49d2c526b919337db07052432d3ee97391c Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:45:23 +0530 Subject: [PATCH 32/34] Update main.yml --- .github/workflows/main.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8f63725..e2c363a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,10 @@ jobs: - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: - tag_name: myTag - files: "dist/*.zip" + tag_name: Datapower25 + files: | + dist/*.zip + dist/*.jar env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + From ebc03f56358c55a173d4cd8359caa4b2fe928a75 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:50:24 +0530 Subject: [PATCH 33/34] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e2c363a..709d01a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: CI on: push: branches: - - actions # Trigger this workflow on pushes to the "actions" branch + - master # Trigger this workflow on pushes to the "master" branch jobs: build_and_release: From 3f7f8f2abd6e794b450b57bcb58741ac9efb8d51 Mon Sep 17 00:00:00 2001 From: Amiya-873 <71648041+Amiya-873@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:51:11 +0530 Subject: [PATCH 34/34] Update build.xml --- build.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.xml b/build.xml index f2915f5..413e886 100644 --- a/build.xml +++ b/build.xml @@ -50,7 +50,7 @@ - +