From 0e62b028516846462661de193adcac1e37b7e804 Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Fri, 12 Apr 2024 14:44:31 -0400 Subject: [PATCH 01/12] Create main.yml --- .github/workflows/main.yml | 60 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 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..3bd511b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,60 @@ +name: Java CI with Gradle + +on: + push: + branches: + - main + +jobs: + build-and-package: + runs-on: ubuntu-latest + + env: + JAVA_HOME: ${{ github.workspace }}/graalvm-community-openjdk-17.0.9+9.1 + PATH: ${{ github.workspace }}/graalvm-community-openjdk-17.0.9+9.1/bin:$PATH + + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Set up JDK 17 from GraalVM + run: | + wget https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-17.0.9/graalvm-community-jdk-17.0.9_linux-x64_bin.tar.gz + tar -xvzf graalvm-community-jdk-17.0.9_linux-x64_bin.tar.gz + mv graalvm-community-openjdk-17.0.9+9.1 ${{ github.workspace }} + gu install native-image + + - name: Make gradlew executable + run: chmod +x ./gradlew + + - name: Build with Gradle + run: ./gradlew clean fatJar nativeCompile + + - name: Publish Jar to GitHub Packages + uses: actions/upload-artifact@v2 + with: + name: codeanalyzer.jar + path: build/libs/*.jar + + # If you want to create a release instead of uploading to GitHub Packages + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.run_number }} + release_name: Release ${{ github.run_number }} + draft: false + prerelease: false + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./build/libs/codeanalyzer.jar + asset_name: codeanalyzer.jar + asset_content_type: application/java-archive + From c020cdc2b2db9faf06aa862e81613eeef456e167 Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Fri, 12 Apr 2024 14:48:18 -0400 Subject: [PATCH 02/12] Update main.yml --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3bd511b..ded126b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,6 +14,9 @@ jobs: PATH: ${{ github.workspace }}/graalvm-community-openjdk-17.0.9+9.1/bin:$PATH steps: + - name: Install tar (if necessary) + run: sudo apt-get update && sudo apt-get install -y tar + - name: Check out code uses: actions/checkout@v2 From 516e9afe5054d3feacd8c156a1e71f6743171aca Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Fri, 12 Apr 2024 14:49:34 -0400 Subject: [PATCH 03/12] 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 ded126b..b4ea837 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,7 @@ jobs: steps: - name: Install tar (if necessary) - run: sudo apt-get update && sudo apt-get install -y tar + run: apt-get update && apt-get install -y tar - name: Check out code uses: actions/checkout@v2 From 284ac2225f28566b136017ad4f2e3fdd38bb87ed Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Fri, 12 Apr 2024 14:53:53 -0400 Subject: [PATCH 04/12] Update main.yml --- .github/workflows/main.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b4ea837..c6eabfa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,11 +14,8 @@ jobs: PATH: ${{ github.workspace }}/graalvm-community-openjdk-17.0.9+9.1/bin:$PATH steps: - - name: Install tar (if necessary) - run: apt-get update && apt-get install -y tar - - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up JDK 17 from GraalVM run: | @@ -34,7 +31,7 @@ jobs: run: ./gradlew clean fatJar nativeCompile - name: Publish Jar to GitHub Packages - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: codeanalyzer.jar path: build/libs/*.jar @@ -52,7 +49,7 @@ jobs: prerelease: false - name: Upload Release Asset - uses: actions/upload-release-asset@v1 + uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: From 88027ce96ef6f10ed7201791f7207c07303bdfd9 Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Fri, 12 Apr 2024 15:01:37 -0400 Subject: [PATCH 05/12] 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 c6eabfa..abb8451 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,6 @@ jobs: env: JAVA_HOME: ${{ github.workspace }}/graalvm-community-openjdk-17.0.9+9.1 - PATH: ${{ github.workspace }}/graalvm-community-openjdk-17.0.9+9.1/bin:$PATH steps: - name: Check out code @@ -19,6 +18,7 @@ jobs: - name: Set up JDK 17 from GraalVM run: | + echo "${{ env.JAVA_HOME }}/bin" >> $GITHUB_PATH wget https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-17.0.9/graalvm-community-jdk-17.0.9_linux-x64_bin.tar.gz tar -xvzf graalvm-community-jdk-17.0.9_linux-x64_bin.tar.gz mv graalvm-community-openjdk-17.0.9+9.1 ${{ github.workspace }} From eb2c32dac513bcad5c6e92bfb5324d6eeb6ad561 Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Fri, 12 Apr 2024 15:02:53 -0400 Subject: [PATCH 06/12] Update main.yml --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index abb8451..25d7a8b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,6 @@ jobs: echo "${{ env.JAVA_HOME }}/bin" >> $GITHUB_PATH wget https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-17.0.9/graalvm-community-jdk-17.0.9_linux-x64_bin.tar.gz tar -xvzf graalvm-community-jdk-17.0.9_linux-x64_bin.tar.gz - mv graalvm-community-openjdk-17.0.9+9.1 ${{ github.workspace }} gu install native-image - name: Make gradlew executable From 74e1c1dafb2c2db349c4861772b65a1e26f0675f Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Fri, 12 Apr 2024 15:05:16 -0400 Subject: [PATCH 07/12] 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 25d7a8b..0a748cf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ jobs: echo "${{ env.JAVA_HOME }}/bin" >> $GITHUB_PATH wget https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-17.0.9/graalvm-community-jdk-17.0.9_linux-x64_bin.tar.gz tar -xvzf graalvm-community-jdk-17.0.9_linux-x64_bin.tar.gz - gu install native-image + ${{ env.JAVA_HOME }}/bin/gu install native-image - name: Make gradlew executable run: chmod +x ./gradlew From 0b5f943786638b49506df0f4796228bb526e4432 Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Fri, 12 Apr 2024 15:10:16 -0400 Subject: [PATCH 08/12] Update main.yml --- .github/workflows/main.yml | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a748cf..fe496c4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,33 +27,10 @@ jobs: run: chmod +x ./gradlew - name: Build with Gradle - run: ./gradlew clean fatJar nativeCompile + run: ./gradlew clean fatJar - name: Publish Jar to GitHub Packages uses: actions/upload-artifact@v4 with: name: codeanalyzer.jar path: build/libs/*.jar - - # If you want to create a release instead of uploading to GitHub Packages - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.run_number }} - release_name: Release ${{ github.run_number }} - draft: false - prerelease: false - - - name: Upload Release Asset - uses: softprops/action-gh-release@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./build/libs/codeanalyzer.jar - asset_name: codeanalyzer.jar - asset_content_type: application/java-archive - From a812b9f78b4782a6c36ead0d4b7e3650b4031e17 Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Fri, 12 Apr 2024 15:24:34 -0400 Subject: [PATCH 09/12] Update main.yml --- .github/workflows/main.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fe496c4..9500afb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,8 +29,9 @@ jobs: - name: Build with Gradle run: ./gradlew clean fatJar - - name: Publish Jar to GitHub Packages - uses: actions/upload-artifact@v4 + - name: Publish Release + uses: softprops/action-gh-release@v1 with: - name: codeanalyzer.jar - path: build/libs/*.jar + files: build/libs/codeanalyzer.jar + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 704f94f74ed4e53e648fac3df5059c7397506e7b Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Fri, 12 Apr 2024 15:35:59 -0400 Subject: [PATCH 10/12] Update main.yml --- .github/workflows/main.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9500afb..d329ed0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,6 +29,13 @@ jobs: - name: Build with Gradle run: ./gradlew clean fatJar + - name: Determine new tag + id: newtag + run: echo "::set-output name=tag::$(date +'%Y%m%d%H%M%S')" + + - name: Create Git Tag + run: git tag ${{ steps.newtag.outputs.tag }} && git push origin ${{ steps.newtag.outputs.tag }} + - name: Publish Release uses: softprops/action-gh-release@v1 with: From b0eaa525633fa5e487dc733931984ff42d21e109 Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Fri, 12 Apr 2024 15:45:03 -0400 Subject: [PATCH 11/12] Update main.yml --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d329ed0..f092ce7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,5 +40,6 @@ jobs: uses: softprops/action-gh-release@v1 with: files: build/libs/codeanalyzer.jar + tag_name: ${{ steps.newtag.outputs.tag }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2498f14032912f7cf9634ac56bc8fa5513f8bd3e Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Fri, 12 Apr 2024 15:47:09 -0400 Subject: [PATCH 12/12] 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 f092ce7..95d7828 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,7 @@ jobs: - name: Determine new tag id: newtag - run: echo "::set-output name=tag::$(date +'%Y%m%d%H%M%S')" + run: echo "::set-output name=tag::$(date +'%Y%m%dT%H%M%S')" - name: Create Git Tag run: git tag ${{ steps.newtag.outputs.tag }} && git push origin ${{ steps.newtag.outputs.tag }}