From 67e19df8f2d40a50abe4869961e18604e6501ca2 Mon Sep 17 00:00:00 2001 From: Lawrence Reinert lareine Date: Mon, 16 Oct 2023 13:00:14 -0400 Subject: [PATCH 01/11] Added a package_linux workflow --- .github/workflows/hirs_package_linux.yml | 81 ++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/hirs_package_linux.yml diff --git a/.github/workflows/hirs_package_linux.yml b/.github/workflows/hirs_package_linux.yml new file mode 100644 index 00000000..f6a570a1 --- /dev/null +++ b/.github/workflows/hirs_package_linux.yml @@ -0,0 +1,81 @@ +name: HIRS packages for centos +on: + push: + branches: + - '*v3*' + - 'main' + workflow_dispatch: + +jobs: + # run the package script for HIRS ACA, Provisioners, tcg_rim_tool, and tcg_eventlog_tool + Package: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'adopt' + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + package_linux: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v2 + - name: directory setup + run: | + mkdir -p artifacts/jars + mkdir -p artifacts/wars + mkdir -p artifacts/rpms + mkdir -p artifacts/debs + - name: Create HIRS packages + uses: actions/setup-java@v3 + with: + java-version: 17 + - name: install dependencies + run: | + sudo apt-get update + sudo apt-get install git curl nano cron mariadb-server + - name: Setup Gradle + - uses: gradle/gradle-build-action@v2 + - name: Execute Gradle build + run: | + pushd /HIRS + ./gradlew build; + ./gradlew bootWar; + ./gradlew buildDeb; + ./gradlew buildRpm; + cp HIRS_AttestationCAPortal/build/libs/*.jar /HIRS/artifacts/jars/. + cp HIRS_AttestationCA/build/libs/*.jar /HIRS/artifacts/jars/. + cp HIRS_Utils/build/libs/*.jar /HIRS/artifacts/jars/. + cp HIRS_Structs/build/libs/*.jar /HIRS/artifacts/jars/. + cp HIRS_AttestationCAPortal/build/libs/HIRS_AttestationCAPortal.war /HIRS/artifacts/wars/. + cp HIRS_AttestationCAPortal/build/distributions/*.rpm /HIRS/artifacts/rpms/. + cp HIRS_AttestationCAPortal/build/distributions/*.deb /HIRS/artifacts/debs/. + popd + - name: Archive RPM files + uses: actions/upload-artifact@v2 + with: + name: RPM_Files + path: artifacts/rpms/* + if-no-files-found: error + - name: Archive DEB files + uses: actions/upload-artifact@v2 + with: + name: DEB_Files + path: artifacts/debs/* + if-no-files-found: error + - name: Archive Jar files + uses: actions/upload-artifact@v2 + with: + name: JAR_Files + path: artifacts/jars/ From cc8d495b6d4f71d6e00909d4175c500236533073 Mon Sep 17 00:00:00 2001 From: iadgovuser26 Date: Mon, 16 Oct 2023 13:15:18 -0400 Subject: [PATCH 02/11] removed unnecessary dash from yaml file --- .github/workflows/hirs_package_linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hirs_package_linux.yml b/.github/workflows/hirs_package_linux.yml index f6a570a1..f4a228bf 100644 --- a/.github/workflows/hirs_package_linux.yml +++ b/.github/workflows/hirs_package_linux.yml @@ -1,4 +1,4 @@ -name: HIRS packages for centos +name: HIRS build and packages for Linux on: push: branches: @@ -46,7 +46,7 @@ jobs: sudo apt-get update sudo apt-get install git curl nano cron mariadb-server - name: Setup Gradle - - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle-build-action@v2 - name: Execute Gradle build run: | pushd /HIRS From 4ea7be00bc2c98311531bdfb3603d16b2e14ffd3 Mon Sep 17 00:00:00 2001 From: iadgovuser26 Date: Mon, 16 Oct 2023 13:26:49 -0400 Subject: [PATCH 03/11] added distribution --- .github/workflows/hirs_package_linux.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/hirs_package_linux.yml b/.github/workflows/hirs_package_linux.yml index f4a228bf..adb11fa6 100644 --- a/.github/workflows/hirs_package_linux.yml +++ b/.github/workflows/hirs_package_linux.yml @@ -41,6 +41,7 @@ jobs: uses: actions/setup-java@v3 with: java-version: 17 + distribution: oracle - name: install dependencies run: | sudo apt-get update From 90a5af2cd720cf66f88f2c44ae65cb4b9f5e7072 Mon Sep 17 00:00:00 2001 From: iadgovuser26 Date: Mon, 16 Oct 2023 13:31:20 -0400 Subject: [PATCH 04/11] removed pushd --- .github/workflows/hirs_package_linux.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hirs_package_linux.yml b/.github/workflows/hirs_package_linux.yml index adb11fa6..e80c1f99 100644 --- a/.github/workflows/hirs_package_linux.yml +++ b/.github/workflows/hirs_package_linux.yml @@ -50,7 +50,9 @@ jobs: uses: gradle/gradle-build-action@v2 - name: Execute Gradle build run: | - pushd /HIRS + pwd + ls + echo "build starts here ....." ./gradlew build; ./gradlew bootWar; ./gradlew buildDeb; @@ -62,7 +64,6 @@ jobs: cp HIRS_AttestationCAPortal/build/libs/HIRS_AttestationCAPortal.war /HIRS/artifacts/wars/. cp HIRS_AttestationCAPortal/build/distributions/*.rpm /HIRS/artifacts/rpms/. cp HIRS_AttestationCAPortal/build/distributions/*.deb /HIRS/artifacts/debs/. - popd - name: Archive RPM files uses: actions/upload-artifact@v2 with: From 262d7a6b7dd1ac6e092287ce9017cc4066706402 Mon Sep 17 00:00:00 2001 From: iadgovuser26 Date: Mon, 16 Oct 2023 13:39:49 -0400 Subject: [PATCH 05/11] changed artifact path --- .github/workflows/hirs_package_linux.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/hirs_package_linux.yml b/.github/workflows/hirs_package_linux.yml index e80c1f99..c2db607a 100644 --- a/.github/workflows/hirs_package_linux.yml +++ b/.github/workflows/hirs_package_linux.yml @@ -57,13 +57,13 @@ jobs: ./gradlew bootWar; ./gradlew buildDeb; ./gradlew buildRpm; - cp HIRS_AttestationCAPortal/build/libs/*.jar /HIRS/artifacts/jars/. - cp HIRS_AttestationCA/build/libs/*.jar /HIRS/artifacts/jars/. - cp HIRS_Utils/build/libs/*.jar /HIRS/artifacts/jars/. - cp HIRS_Structs/build/libs/*.jar /HIRS/artifacts/jars/. - cp HIRS_AttestationCAPortal/build/libs/HIRS_AttestationCAPortal.war /HIRS/artifacts/wars/. - cp HIRS_AttestationCAPortal/build/distributions/*.rpm /HIRS/artifacts/rpms/. - cp HIRS_AttestationCAPortal/build/distributions/*.deb /HIRS/artifacts/debs/. + cp HIRS_AttestationCAPortal/build/libs/*.jar artifacts/jars/. + cp HIRS_AttestationCA/build/libs/*.jar artifacts/jars/. + cp HIRS_Utils/build/libs/*.jar artifacts/jars/. + cp HIRS_Structs/build/libs/*.jar artifacts/jars/. + cp HIRS_AttestationCAPortal/build/libs/HIRS_AttestationCAPortal.war artifacts/wars/. + cp HIRS_AttestationCAPortal/build/distributions/*.rpm artifacts/rpms/. + cp HIRS_AttestationCAPortal/build/distributions/*.deb artifacts/debs/. - name: Archive RPM files uses: actions/upload-artifact@v2 with: From 0c851c593f6a13499eab44a5db3152e2a775f0d9 Mon Sep 17 00:00:00 2001 From: iadgovuser26 Date: Mon, 16 Oct 2023 13:56:27 -0400 Subject: [PATCH 06/11] updated referenced actions --- .github/workflows/hirs_package_linux.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/hirs_package_linux.yml b/.github/workflows/hirs_package_linux.yml index c2db607a..6e775149 100644 --- a/.github/workflows/hirs_package_linux.yml +++ b/.github/workflows/hirs_package_linux.yml @@ -15,12 +15,12 @@ jobs: packages: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up JDK 17 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: java-version: '17' - distribution: 'adopt' + distribution: 'temurin' server-id: github # Value of the distributionManagement/repository/id field of the pom.xml settings-path: ${{ github.workspace }} # location for the settings.xml file @@ -30,18 +30,12 @@ jobs: contents: read packages: write steps: - - uses: actions/checkout@v2 - name: directory setup run: | mkdir -p artifacts/jars mkdir -p artifacts/wars mkdir -p artifacts/rpms mkdir -p artifacts/debs - - name: Create HIRS packages - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: oracle - name: install dependencies run: | sudo apt-get update From 7313d98c523a4115523533ebd3a5e55f3c2deb72 Mon Sep 17 00:00:00 2001 From: iadgovuser26 Date: Mon, 16 Oct 2023 14:04:10 -0400 Subject: [PATCH 07/11] combined jobs --- .github/workflows/hirs_package_linux.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/hirs_package_linux.yml b/.github/workflows/hirs_package_linux.yml index 6e775149..bedd1ce1 100644 --- a/.github/workflows/hirs_package_linux.yml +++ b/.github/workflows/hirs_package_linux.yml @@ -8,7 +8,7 @@ on: jobs: # run the package script for HIRS ACA, Provisioners, tcg_rim_tool, and tcg_eventlog_tool - Package: + Package_linux: runs-on: ubuntu-latest permissions: contents: read @@ -23,13 +23,6 @@ jobs: distribution: 'temurin' server-id: github # Value of the distributionManagement/repository/id field of the pom.xml settings-path: ${{ github.workspace }} # location for the settings.xml file - - package_linux: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - name: directory setup run: | mkdir -p artifacts/jars From 279b3f6f41a317906f8d7e7c73a212b160124073 Mon Sep 17 00:00:00 2001 From: iadgovuser26 Date: Mon, 16 Oct 2023 14:11:35 -0400 Subject: [PATCH 08/11] updated upload-artifact version --- .github/workflows/hirs_package_linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hirs_package_linux.yml b/.github/workflows/hirs_package_linux.yml index bedd1ce1..289f39bc 100644 --- a/.github/workflows/hirs_package_linux.yml +++ b/.github/workflows/hirs_package_linux.yml @@ -58,13 +58,13 @@ jobs: path: artifacts/rpms/* if-no-files-found: error - name: Archive DEB files - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: DEB_Files path: artifacts/debs/* if-no-files-found: error - name: Archive Jar files - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: JAR_Files path: artifacts/jars/ From 329f5afb91143cbc817366185632b41b7e620e6d Mon Sep 17 00:00:00 2001 From: iadgovuser26 Date: Mon, 16 Oct 2023 14:23:27 -0400 Subject: [PATCH 09/11] updated another upload-artifact version --- .github/workflows/hirs_package_linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hirs_package_linux.yml b/.github/workflows/hirs_package_linux.yml index 289f39bc..fcb0c810 100644 --- a/.github/workflows/hirs_package_linux.yml +++ b/.github/workflows/hirs_package_linux.yml @@ -52,7 +52,7 @@ jobs: cp HIRS_AttestationCAPortal/build/distributions/*.rpm artifacts/rpms/. cp HIRS_AttestationCAPortal/build/distributions/*.deb artifacts/debs/. - name: Archive RPM files - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: RPM_Files path: artifacts/rpms/* From 561280a2638858bb73ecf9ab33a1d062a82c01de Mon Sep 17 00:00:00 2001 From: iadgovuser26 Date: Mon, 16 Oct 2023 15:24:45 -0400 Subject: [PATCH 10/11] removed debug statments --- .github/workflows/hirs_package_linux.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/hirs_package_linux.yml b/.github/workflows/hirs_package_linux.yml index fcb0c810..25fad7c6 100644 --- a/.github/workflows/hirs_package_linux.yml +++ b/.github/workflows/hirs_package_linux.yml @@ -37,9 +37,6 @@ jobs: uses: gradle/gradle-build-action@v2 - name: Execute Gradle build run: | - pwd - ls - echo "build starts here ....." ./gradlew build; ./gradlew bootWar; ./gradlew buildDeb; From 51ae60e6393a51cccc532c550a2d01f9a941d4e8 Mon Sep 17 00:00:00 2001 From: iadgovuser26 Date: Wed, 18 Oct 2023 08:40:52 -0400 Subject: [PATCH 11/11] Added a war file artifact --- .github/workflows/hirs_package_linux.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/hirs_package_linux.yml b/.github/workflows/hirs_package_linux.yml index 25fad7c6..5406ad06 100644 --- a/.github/workflows/hirs_package_linux.yml +++ b/.github/workflows/hirs_package_linux.yml @@ -26,9 +26,6 @@ jobs: - name: directory setup run: | mkdir -p artifacts/jars - mkdir -p artifacts/wars - mkdir -p artifacts/rpms - mkdir -p artifacts/debs - name: install dependencies run: | sudo apt-get update @@ -45,23 +42,28 @@ jobs: cp HIRS_AttestationCA/build/libs/*.jar artifacts/jars/. cp HIRS_Utils/build/libs/*.jar artifacts/jars/. cp HIRS_Structs/build/libs/*.jar artifacts/jars/. - cp HIRS_AttestationCAPortal/build/libs/HIRS_AttestationCAPortal.war artifacts/wars/. - cp HIRS_AttestationCAPortal/build/distributions/*.rpm artifacts/rpms/. - cp HIRS_AttestationCAPortal/build/distributions/*.deb artifacts/debs/. - name: Archive RPM files uses: actions/upload-artifact@v3 with: name: RPM_Files - path: artifacts/rpms/* + path: HIRS_AttestationCAPortal/build/distributions/*.rpm if-no-files-found: error - name: Archive DEB files uses: actions/upload-artifact@v3 with: name: DEB_Files - path: artifacts/debs/* + path: HIRS_AttestationCAPortal/build/distributions/*.deb if-no-files-found: error - - name: Archive Jar files + - name: War files + uses: actions/upload-artifact@v3 + with: + name: WAR_Files + path: HIRS_AttestationCAPortal/build/libs/HIRS_AttestationCAPortal.war + if-no-files-found: error + - name: JAR_Files uses: actions/upload-artifact@v3 with: name: JAR_Files path: artifacts/jars/ + if-no-files-found: error + \ No newline at end of file