diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 527fc3da1..a63d6f886 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -108,43 +108,42 @@ jobs: echo "SNAPI_CLIENT=$(cat snapi-client/version)" >> $GITHUB_ENV echo "SQL_CLIENT=$(cat sql-client/version)" >> $GITHUB_ENV - if: github.event_name == 'repository_dispatch' - uses: peter-evans/create-or-update-comment@v2 + uses: peter-evans/create-or-update-comment@v4 with: token: ${{ secrets.RAW_CI_PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} comment-id: ${{ github.event.client_payload.github.payload.comment.id }} body: | - > will publish utils version: ${{ env.UTILS_VER }} - > will publish client version: ${{ env.CLIENT_VER }} - > will publish snapi-frontend version: ${{ env.SNAPI_FRONTEND_VER }} - > will publish snapi-truffle version: ${{ env.SNAPI_TRUFFLE_VER }} - > will publish snapi-client version: ${{ env.SNAPI_CLIENT }} - > will publish sql-client version: ${{ env.SQL_CLIENT }} + > published utils version: ${{ env.UTILS_VER }} + > published client version: ${{ env.CLIENT_VER }} + > published snapi-frontend version: ${{ env.SNAPI_FRONTEND_VER }} + > published snapi-truffle version: ${{ env.SNAPI_TRUFFLE_VER }} + > published snapi-client version: ${{ env.SNAPI_CLIENT }} + > published sql-client version: ${{ env.SQL_CLIENT }} reactions: rocket - if: success() && github.event_name == 'push' && contains(github.ref, 'refs/tags/') - uses: peter-evans/repository-dispatch@v2 + uses: peter-evans/repository-dispatch@v3 with: token: ${{ secrets.RAW_CI_PAT }} event-type: release client-payload: '{"ref": "${{ github.ref }}", "tag": "${{ github.ref_name }}"}' - if: success() && github.event_name == 'repository_dispatch' - uses: peter-evans/create-or-update-comment@v2 + uses: peter-evans/create-or-update-comment@v4 with: token: ${{ secrets.RAW_CI_PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} comment-id: ${{ github.event.client_payload.github.payload.comment.id }} body: | - > published - > run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) success :heavy_check_mark: + > run [${{ github.run_id }}/$GITHUB_JOB](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) success :heavy_check_mark: reactions: hooray - if: failure() && github.event_name == 'repository_dispatch' - uses: peter-evans/create-or-update-comment@v2 + uses: peter-evans/create-or-update-comment@v4 with: token: ${{ secrets.RAW_CI_PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} comment-id: ${{ github.event.client_payload.github.payload.comment.id }} body: | - > run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) failed :x: + > run [${{ github.run_id }}/$GITHUB_JOB](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) failed :x: reactions: confused publish-snapi-parser: @@ -191,7 +190,8 @@ jobs: "key": "gpg.keyname", "value": "${{ secrets.GPG_KEYNAME }}" }] - - name: publish + - if: github.event_name == 'repository_dispatch' + name: publish to snapshots repo working-directory: snapi-parser run: | ./publish.sh @@ -199,38 +199,39 @@ jobs: - if: github.event_name != 'repository_dispatch' name: release working-directory: snapi-parser - run: ./release.sh + run: | + ./release.sh + echo SNAPI_PARSER_VER="$(cat version)" >> $GITHUB_ENV - if: github.event_name == 'repository_dispatch' - uses: peter-evans/create-or-update-comment@v2 + uses: peter-evans/create-or-update-comment@v4 with: token: ${{ secrets.RAW_CI_PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} comment-id: ${{ github.event.client_payload.github.payload.comment.id }} body: | - > will publish snapi-parser version: ${{ env.SNAPI_PARSER_VER }} + > published snapi-parser version: ${{ env.SNAPI_PARSER_VER }} reactions: rocket - if: success() && github.event_name == 'push' && contains(github.ref, 'refs/tags/') - uses: peter-evans/repository-dispatch@v2 + uses: peter-evans/repository-dispatch@v3 with: token: ${{ secrets.RAW_CI_PAT }} event-type: release client-payload: '{"ref": "${{ github.ref }}", "tag": "${{ github.ref_name }}"}' - if: success() && github.event_name == 'repository_dispatch' - uses: peter-evans/create-or-update-comment@v2 + uses: peter-evans/create-or-update-comment@v4 with: token: ${{ secrets.RAW_CI_PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} comment-id: ${{ github.event.client_payload.github.payload.comment.id }} body: | - > published - > run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) success :heavy_check_mark: + > run [${{ github.run_id }}/$GITHUB_JOB](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) success :heavy_check_mark: reactions: hooray - if: failure() && github.event_name == 'repository_dispatch' - uses: peter-evans/create-or-update-comment@v2 + uses: peter-evans/create-or-update-comment@v4 with: token: ${{ secrets.RAW_CI_PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} comment-id: ${{ github.event.client_payload.github.payload.comment.id }} body: | - > run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) failed :x: + > run [${{ github.run_id }}/$GITHUB_JOB](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) failed :x: reactions: confused diff --git a/snapi-parser/build.sh b/snapi-parser/build.sh index 0ee1a39cc..c32ab184a 100755 --- a/snapi-parser/build.sh +++ b/snapi-parser/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -e SCRIPT_HOME="$(cd "$(dirname "$0")"; pwd)" -[ "$CI" == "true" ] && { export MAVEN_CLI_OPTS="-B";} +[ "$CI" == "true" ] && { export HOME=/home/sbtuser; export MAVEN_CLI_OPTS="-B";} . ~/.sdkman/bin/sdkman-init.sh yes n | sdk install java 21-graalce || true diff --git a/snapi-parser/publish.sh b/snapi-parser/publish.sh index c90a547cb..d97ec59c4 100755 --- a/snapi-parser/publish.sh +++ b/snapi-parser/publish.sh @@ -9,5 +9,5 @@ sdk use java 21-graalce cd "$SCRIPT_HOME" VERSION=$(git describe --tags | sed 's/^v//;s/-\([0-9]*\)-g/+\1-/') -mvn clean deploy -Pdev,deploy -Drevision=$VERSION -Dchangelist= +mvn clean deploy -Pdev,deploy -Drevision=$VERSION echo "${VERSION}" > version diff --git a/snapi-parser/release.sh b/snapi-parser/release.sh index e1216af53..e2d101370 100755 --- a/snapi-parser/release.sh +++ b/snapi-parser/release.sh @@ -10,5 +10,6 @@ cd "$SCRIPT_HOME" VERSION=$(git describe --tags | sed 's/^v//;s/-\([0-9]*\)-g/+\1-/') export MAVEN_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED" +mvn clean deploy -Pdev,deploy -Drevision=$VERSION -Dchangelist= mvn nexus-staging:release -Pdev,deploy -Drevision=$VERSION -Dchangelist= echo "${VERSION}" > version