From 1c4cb4358ca419d378d537e8d3b393868f4c1bec Mon Sep 17 00:00:00 2001 From: Bajczi Levente Date: Fri, 7 Jul 2023 10:13:01 +0200 Subject: [PATCH 1/7] Fix action versions to commits, bump versions, add -x test flag to binary build --- .github/workflows/CD-create_release.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CD-create_release.yml b/.github/workflows/CD-create_release.yml index 2b776f88b5..991772a1dc 100644 --- a/.github/workflows/CD-create_release.yml +++ b/.github/workflows/CD-create_release.yml @@ -7,18 +7,18 @@ jobs: runs-on: - ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0 with: distribution: temurin java-version: 17 - name: Setup and execute Gradle 'build' task - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 # v2.4.2 id: build with: - arguments: build --scan + arguments: build -x test --scan - run: 'echo "${{steps.build.outputs.build}}"' - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 with: name: ThetaJars path: subprojects/**/*-all.jar @@ -27,7 +27,7 @@ jobs: needs: gradle runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: Creating version number run: >- echo "version=v$(grep "version" build.gradle.kts | tail -n 1 | cut -d @@ -35,7 +35,7 @@ jobs: id: value shell: bash - run: 'echo "${{steps.value.outputs.version}}"' - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: name: ThetaJars path: jar/ @@ -44,7 +44,7 @@ jobs: - run: find jar - run: for i in $(find jar -name "*-all.jar"); do mv $i jar/$(basename ${i%-${{steps.value.outputs.version}}-all.jar}.jar); done - name: Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1.0 with: files: jar/**/*.jar body: "Auto-generated release" From 738d5337e42989fa9740aac99ad1dae4e7c19731 Mon Sep 17 00:00:00 2001 From: Bajczi Levente Date: Fri, 7 Jul 2023 10:57:42 +0200 Subject: [PATCH 2/7] Add message to automated release generation --- .github/workflows/CD-create_release.yml | 27 ++++++++++++++++--------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/CD-create_release.yml b/.github/workflows/CD-create_release.yml index 991772a1dc..3d58a87062 100644 --- a/.github/workflows/CD-create_release.yml +++ b/.github/workflows/CD-create_release.yml @@ -1,6 +1,10 @@ name: Create release file 'on': - workflow_dispatch: null + workflow_dispatch: + inputs: + message: + required: false + default: 'Auto generated release' jobs: gradle: name: Run Gradle @@ -28,10 +32,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - - name: Creating version number - run: >- - echo "version=v$(grep "version" build.gradle.kts | tail -n 1 | cut -d - "=" -f2 | xargs echo )" >> $GITHUB_OUTPUT + - name: Creating versions + run: | + echo "version=$(grep "version" build.gradle.kts | tail -n 1 | cut -d "=" -f2 | xargs echo )" >> $GITHUB_OUTPUT + echo "tagname=v$(grep "version" build.gradle.kts | tail -n 1 | cut -d "=" -f2 | xargs echo )" >> $GITHUB_OUTPUT + echo "subprojects=$(git diff $(git describe --abbrev=0 --tags) --name-only | grep 'subprojects' | awk -F '/' '{ print $2"/"$3 }' | sort | uniq)" >> $GITHUB_OUTPUT + - name: Creating message + run: | + echo "message=${{ inputs.message }}\n\nModified subprojects:\n${{steps.value.outputs.subprojects}}" >> $GITHUB_OUTPUT id: value shell: bash - run: 'echo "${{steps.value.outputs.version}}"' @@ -41,13 +49,12 @@ jobs: path: jar/ - name: Display structure of downloaded files run: ls -R - - run: find jar - - run: for i in $(find jar -name "*-all.jar"); do mv $i jar/$(basename ${i%-${{steps.value.outputs.version}}-all.jar}.jar); done + - run: for i in $(find jar -name "*-all.jar"); do mv -v $i jar/$(basename ${i%-${{steps.value.outputs.version}}-all.jar}.jar); done - name: Release uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1.0 with: files: jar/**/*.jar - body: "Auto-generated release" - name: ${{steps.value.outputs.version}} - tag_name: ${{steps.value.outputs.version}} + body: ${{steps.value.outputs.message}} + name: ${{steps.value.outputs.tagname}} + tag_name: ${{steps.value.outputs.tagname}} From fbff54567f774cb74ff4c972a4a081370b571e30 Mon Sep 17 00:00:00 2001 From: Bajczi Levente Date: Fri, 7 Jul 2023 11:14:46 +0200 Subject: [PATCH 3/7] Update CD-create_release.yml --- .github/workflows/CD-create_release.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CD-create_release.yml b/.github/workflows/CD-create_release.yml index 3d58a87062..bb807dc656 100644 --- a/.github/workflows/CD-create_release.yml +++ b/.github/workflows/CD-create_release.yml @@ -32,6 +32,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + with: + fetch-depth: 0 - name: Creating versions run: | echo "version=$(grep "version" build.gradle.kts | tail -n 1 | cut -d "=" -f2 | xargs echo )" >> $GITHUB_OUTPUT @@ -40,9 +42,12 @@ jobs: - name: Creating message run: | echo "message=${{ inputs.message }}\n\nModified subprojects:\n${{steps.value.outputs.subprojects}}" >> $GITHUB_OUTPUT - id: value - shell: bash - - run: 'echo "${{steps.value.outputs.version}}"' + - name: Verify variables + run: | + echo version "${{steps.value.outputs.version}} + echo tagname "${{steps.value.outputs.tagname}} + echo subprojects "${{steps.value.outputs.subprojects}} + echo message "${{steps.value.outputs.message}} - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: name: ThetaJars From 2f743cbad30b72347c23337ee5846fd87d2f7f57 Mon Sep 17 00:00:00 2001 From: Bajczi Levente Date: Fri, 7 Jul 2023 11:24:33 +0200 Subject: [PATCH 4/7] Fix outputs --- .github/workflows/CD-create_release.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CD-create_release.yml b/.github/workflows/CD-create_release.yml index bb807dc656..4c5fe0eb4d 100644 --- a/.github/workflows/CD-create_release.yml +++ b/.github/workflows/CD-create_release.yml @@ -35,13 +35,15 @@ jobs: with: fetch-depth: 0 - name: Creating versions + id: 'value' run: | - echo "version=$(grep "version" build.gradle.kts | tail -n 1 | cut -d "=" -f2 | xargs echo )" >> $GITHUB_OUTPUT - echo "tagname=v$(grep "version" build.gradle.kts | tail -n 1 | cut -d "=" -f2 | xargs echo )" >> $GITHUB_OUTPUT - echo "subprojects=$(git diff $(git describe --abbrev=0 --tags) --name-only | grep 'subprojects' | awk -F '/' '{ print $2"/"$3 }' | sort | uniq)" >> $GITHUB_OUTPUT - - name: Creating message - run: | - echo "message=${{ inputs.message }}\n\nModified subprojects:\n${{steps.value.outputs.subprojects}}" >> $GITHUB_OUTPUT + export version=$(grep "version" build.gradle.kts | tail -n 1 | cut -d "=" -f2 | xargs echo ) + export subprojects=$(git diff $(git describe --abbrev=0 --tags) --name-only | grep 'subprojects' | awk -F '/' '{ print $2"/"$3 }' | sort | uniq) + export message=$(printf ${{ inputs.message }}\n\nModified subprojects:\n${{steps.value.outputs.subprojects}}) + echo "version=$version" >> $GITHUB_OUTPUT + echo "tagname=v$version" >> $GITHUB_OUTPUT + echo "subprojects=$subprojects" >> $GITHUB_OUTPUT + echo "message=$message" >> $GITHUB_OUTPUT - name: Verify variables run: | echo version "${{steps.value.outputs.version}} From e672159d988a432106aba515513ef977b4deacd0 Mon Sep 17 00:00:00 2001 From: Bajczi Levente Date: Fri, 7 Jul 2023 11:33:15 +0200 Subject: [PATCH 5/7] Fixed printfs --- .github/workflows/CD-create_release.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CD-create_release.yml b/.github/workflows/CD-create_release.yml index 4c5fe0eb4d..15d528bcad 100644 --- a/.github/workflows/CD-create_release.yml +++ b/.github/workflows/CD-create_release.yml @@ -38,8 +38,10 @@ jobs: id: 'value' run: | export version=$(grep "version" build.gradle.kts | tail -n 1 | cut -d "=" -f2 | xargs echo ) - export subprojects=$(git diff $(git describe --abbrev=0 --tags) --name-only | grep 'subprojects' | awk -F '/' '{ print $2"/"$3 }' | sort | uniq) - export message=$(printf ${{ inputs.message }}\n\nModified subprojects:\n${{steps.value.outputs.subprojects}}) + export lasttag=$(git describe --abbrev=0 --tags) + echo Last tag: $lasttag + export subprojects=$(git diff $lasttag --name-only | grep 'subprojects' | awk -F '/' '{ print $2"/"$3 }' | sort | uniq) + export message=$(printf "${{ inputs.message }}\n\nModified subprojects (since $lasttag):\n${{steps.value.outputs.subprojects}}") echo "version=$version" >> $GITHUB_OUTPUT echo "tagname=v$version" >> $GITHUB_OUTPUT echo "subprojects=$subprojects" >> $GITHUB_OUTPUT From 298e1793a0682d3ba49432a383c058c7b66bdb96 Mon Sep 17 00:00:00 2001 From: Bajczi Levente Date: Fri, 7 Jul 2023 11:50:06 +0200 Subject: [PATCH 6/7] Fixed multiline string in github output --- .github/workflows/CD-create_release.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CD-create_release.yml b/.github/workflows/CD-create_release.yml index 15d528bcad..19f7921705 100644 --- a/.github/workflows/CD-create_release.yml +++ b/.github/workflows/CD-create_release.yml @@ -41,16 +41,19 @@ jobs: export lasttag=$(git describe --abbrev=0 --tags) echo Last tag: $lasttag export subprojects=$(git diff $lasttag --name-only | grep 'subprojects' | awk -F '/' '{ print $2"/"$3 }' | sort | uniq) - export message=$(printf "${{ inputs.message }}\n\nModified subprojects (since $lasttag):\n${{steps.value.outputs.subprojects}}") + echo Modified subprojects: $subprojects + export message=$(printf "${{ inputs.message }}\n\nModified subprojects (since $lasttag):\n$subprojects") + echo Message: $message echo "version=$version" >> $GITHUB_OUTPUT echo "tagname=v$version" >> $GITHUB_OUTPUT - echo "subprojects=$subprojects" >> $GITHUB_OUTPUT - echo "message=$message" >> $GITHUB_OUTPUT + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) + echo "message<<$EOF" >> $GITHUB_OUTPUT + echo $message >> $GITHUB_OUTPUT + echo "$EOF" >> $GITHUB_OUTPUT - name: Verify variables run: | echo version "${{steps.value.outputs.version}} echo tagname "${{steps.value.outputs.tagname}} - echo subprojects "${{steps.value.outputs.subprojects}} echo message "${{steps.value.outputs.message}} - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: From 542222642b077fa6bab459e69e8c77abe86e3b28 Mon Sep 17 00:00:00 2001 From: Bajczi Levente Date: Fri, 7 Jul 2023 11:58:18 +0200 Subject: [PATCH 7/7] Fix missing " --- .github/workflows/CD-create_release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CD-create_release.yml b/.github/workflows/CD-create_release.yml index 19f7921705..d7e0bef4e0 100644 --- a/.github/workflows/CD-create_release.yml +++ b/.github/workflows/CD-create_release.yml @@ -52,9 +52,9 @@ jobs: echo "$EOF" >> $GITHUB_OUTPUT - name: Verify variables run: | - echo version "${{steps.value.outputs.version}} - echo tagname "${{steps.value.outputs.tagname}} - echo message "${{steps.value.outputs.message}} + echo version "${{steps.value.outputs.version}}" + echo tagname "${{steps.value.outputs.tagname}}" + echo message "${{steps.value.outputs.message}}" - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: name: ThetaJars