diff --git a/.github/workflows/buildVictoryChartRenderer.yml b/.github/workflows/buildVictoryChartRenderer.yml new file mode 100644 index 000000000000..2650cf79b987 --- /dev/null +++ b/.github/workflows/buildVictoryChartRenderer.yml @@ -0,0 +1,75 @@ +name: Build victory-chart-renderer + +on: + workflow_call: + inputs: + ref: + description: Git ref to checkout and build + type: string + required: true + release-tag: + description: GitHub Release tag for this deploy (used in failure notifications) + type: string + required: true + + outputs: + BINARY_FILENAME: + description: Filename of the compiled Linux x64 binary + value: ${{ jobs.build.outputs.BINARY_FILENAME }} + +jobs: + build: + name: Build victory-chart-renderer (Linux x64) + runs-on: blacksmith-8vcpu-ubuntu-2404 + outputs: + BINARY_FILENAME: victory-chart-renderer-linux-x64 + steps: + - name: Checkout + uses: useblacksmith/checkout@c9796daa2a4bdebdab5bd16be2c09a70cd4e1121 # v1 + with: + ref: ${{ inputs.ref }} + + - name: Setup Node + uses: ./.github/actions/composite/setupNode + + - name: Setup Bun + # v2.0.2 + uses: oven-sh/setup-bun@81fe9a935c4d9aed6ff8654c7e6e27f3df8dc3ae + with: + bun-version-file: .bun-version + + - name: Build victory-chart-renderer Linux x64 binary + run: npm run server:vcr:build:linux + + - name: Verify compiled binary is executable + run: test -x server/victory-chart-renderer/dist/victory-chart-renderer-linux-x64 + + - name: Upload victory-chart-renderer Linux x64 artifact + # v6 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f + with: + name: victory-chart-renderer-linux-x64-artifact + path: server/victory-chart-renderer/dist/victory-chart-renderer-linux-x64 + + - name: Log victory-chart-renderer build failure + if: failure() || cancelled() + run: | + echo "::error::victory-chart-renderer Linux x64 build did not succeed for release ${{ inputs.release-tag }}. GitHub Release will not include victory-chart-renderer-linux-x64." + + - name: Announce victory-chart-renderer build failure in Slack + if: failure() || cancelled() + # v3 + uses: 8398a7/action-slack@1750b5085f3ec60384090fb7c52965ef822e869e + with: + status: custom + custom_payload: | + { + channel: '#announce', + attachments: [{ + color: 'warning', + text: `⚠️ ${process.env.AS_REPO} failed for deploy release . victory-chart-renderer-linux-x64 will not be attached.`, + }] + } + env: + GITHUB_TOKEN: ${{ github.token }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7aa44fc266ca..a10d840e8c6f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -649,6 +649,15 @@ jobs: environment: ${{ needs.prep.outputs.DEPLOY_ENV }} secrets: inherit + victoryChartRendererBuild: + name: Build victory-chart-renderer (Linux x64) + needs: [prep] + uses: ./.github/workflows/buildVictoryChartRenderer.yml + with: + ref: ${{ needs.prep.outputs.DEPLOY_SHA }} + release-tag: ${{ needs.prep.outputs.TAG }} + secrets: inherit + webDeploy: name: Deploy Web to S3 needs: [prep, webBuild, buildStorybook] @@ -868,7 +877,7 @@ jobs: createRelease: runs-on: blacksmith-2vcpu-ubuntu-2404 if: ${{ always() && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }} - needs: [prep, checkDeploymentSuccess] + needs: [prep, checkDeploymentSuccess, victoryChartRendererBuild] permissions: contents: write steps: @@ -958,6 +967,15 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} + - name: Upload victory-chart-renderer to GitHub Release + if: ${{ needs.victoryChartRendererBuild.result == 'success' }} + run: | + test -x ./victory-chart-renderer-linux-x64-artifact/victory-chart-renderer-linux-x64 + gh release upload "${{ needs.prep.outputs.TAG }}" --repo "${{ github.repository }}" --clobber \ + "./victory-chart-renderer-linux-x64-artifact/victory-chart-renderer-linux-x64#victory-chart-renderer-linux-x64" + env: + GITHUB_TOKEN: ${{ github.token }} + - name: Warn deployers if deploy failed if: ${{ failure() }} # v3