feat: make jar release condition to unit and replay passing by default' #265
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # The purpose of this workflow is to upload the necessary assets when | ||
| # a release is made manually on github. | ||
| name: Manual Release Assets | ||
| permissions: | ||
| contents: write | ||
| packages: write | ||
| on: | ||
| release: | ||
| workflow_dispatch: | ||
| inputs: | ||
| release_tag: | ||
| description: Specify tag where assets should be added. | ||
| required: true | ||
| type: string | ||
| default: "v1.2.3" | ||
| wait-for-tests-bef-publish: | ||
| description: 'If "false", the release jar will be published when ready without waiting for the unit and replay tests to pass.' | ||
| required: false | ||
| type: string | ||
| default: 'true' | ||
| jobs: | ||
| # ================================================================== | ||
| # Build - for release and for tests | ||
| # ================================================================== | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| with: | ||
| submodules: false | ||
| - name: Setup Environment | ||
| # setup go-corset | ||
| uses: ./.github/actions/setup-environment | ||
| - name: Configure Tag | ||
| id: config | ||
| # set tag to use in subsequent steps. | ||
| run: echo "TAG=$tag_name" >> $GITHUB_OUTPUT | ||
| env: | ||
| tag_name: ${{ inputs.release_tag || github.event.release.tag_name }} | ||
| - name: Build Assets | ||
| run: ./gradlew artifacts -PreleaseVersion=${{ steps.config.outputs.TAG }} | ||
| env: | ||
| JAVA_OPTS: -Xmx2g -Dorg.gradle.daemon=false | ||
| - name: Upload Assets | ||
| run: | | ||
| gh release upload ${{ steps.config.outputs.TAG }} $jar_asset | ||
| gh release upload ${{ steps.config.outputs.TAG }} $zip_asset | ||
| env: | ||
| jar_asset: ${{ github.workspace }}/plugins/build/libs/linea-tracer-${{ steps.config.outputs.TAG }}.jar | ||
| zip_asset: ${{ github.workspace }}/plugins/build/distributions/linea-tracer-${{ steps.config.outputs.TAG }}.zip | ||
| GH_TOKEN: ${{ github.token }} | ||
| - name: Set up GCC | ||
| uses: egor-tensin/setup-gcc@eaa888eb19115a521fa72b65cd94fe1f25bbcaac #v1.3 | ||
| - name: Build without tests | ||
| run: ./gradlew build -x test -x spotlessCheck | ||
| env: | ||
| JAVA_OPTS: -Xmx2g -Dorg.gradle.daemon=false | ||
| - name: Store distribution artifacts | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
| with: | ||
| name: distributions | ||
| path: arithmetization/build/libs | ||
| - name: Run spotless | ||
| run: ./gradlew --no-daemon --parallel clean spotlessCheck | ||
| # ================================================================== | ||
| # Unit Tests | ||
| # ================================================================== | ||
| unit-tests-prague: | ||
| needs: [ build ] | ||
| uses: ./.github/workflows/reusable-unit-tests.yml | ||
| with: | ||
| zkevm_fork: PRAGUE | ||
| tests-with-ssh: false | ||
| # ================================================================== | ||
| # Fast Replay Tests | ||
| # ================================================================== | ||
| replay-tests: | ||
| needs: [ build ] | ||
| uses: ./.github/workflows/reusable-fast-replay-tests.yml | ||
| with: | ||
| tests-with-ssh: ${{ inputs.tests-with-ssh || false}} | ||
| # ================================================================== | ||
| # Publish release post tests | ||
| # ================================================================== | ||
| publish-conditional-to-units-and-replay-tests: | ||
| needs: [ build, unit-tests-prague, replay-tests ] | ||
| if: ${{ github.event_name != 'pull_request' && inputs.wait-for-tests-bef-publish == 'true'}} | ||
| runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-med | ||
| env: | ||
| architecture: "amd64" | ||
| GRADLE_OPTS: "-Xmx6g -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=4" | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| - name: Setup Environment | ||
| uses: ./.github/actions/setup-environment | ||
| - name: Publish Java artifacts | ||
| run: ./gradlew publish | ||
| env: | ||
| CLOUDSMITH_USER: ${{ secrets.CLOUDSMITH_USER }} | ||
| CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} | ||
| publish-as-soon-as-ready: | ||
| needs: [ build ] | ||
| if: ${{ github.event_name != 'pull_request' && inputs.wait-for-tests-bef-publish == 'false'}} | ||
| runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-med | ||
| env: | ||
| architecture: "amd64" | ||
| GRADLE_OPTS: "-Xmx6g -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=4" | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| - name: Setup Environment | ||
| uses: ./.github/actions/setup-environment | ||
| - name: Publish Java artifacts | ||
| run: ./gradlew publish | ||
| env: | ||
| CLOUDSMITH_USER: ${{ secrets.CLOUDSMITH_USER }} | ||
| CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} | ||