|
| 1 | +name: Build victory-chart-renderer |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + ref: |
| 7 | + description: Git ref to checkout and build |
| 8 | + type: string |
| 9 | + required: true |
| 10 | + release-tag: |
| 11 | + description: GitHub Release tag for this deploy (used in failure notifications) |
| 12 | + type: string |
| 13 | + required: true |
| 14 | + |
| 15 | + outputs: |
| 16 | + BINARY_FILENAME: |
| 17 | + description: Filename of the compiled Linux x64 binary |
| 18 | + value: ${{ jobs.build.outputs.BINARY_FILENAME }} |
| 19 | + |
| 20 | +jobs: |
| 21 | + build: |
| 22 | + name: Build victory-chart-renderer (Linux x64) |
| 23 | + runs-on: blacksmith-8vcpu-ubuntu-2404 |
| 24 | + outputs: |
| 25 | + BINARY_FILENAME: victory-chart-renderer-linux-x64 |
| 26 | + steps: |
| 27 | + - name: Checkout |
| 28 | + uses: useblacksmith/checkout@c9796daa2a4bdebdab5bd16be2c09a70cd4e1121 # v1 |
| 29 | + with: |
| 30 | + ref: ${{ inputs.ref }} |
| 31 | + |
| 32 | + - name: Setup Node |
| 33 | + uses: ./.github/actions/composite/setupNode |
| 34 | + |
| 35 | + - name: Setup Bun |
| 36 | + # v2.2.0 |
| 37 | + uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 |
| 38 | + with: |
| 39 | + bun-version-file: .bun-version |
| 40 | + |
| 41 | + - name: Build victory-chart-renderer Linux x64 binary |
| 42 | + run: npm run server:vcr:build:linux |
| 43 | + |
| 44 | + - name: Verify compiled binary is executable |
| 45 | + run: test -x server/victory-chart-renderer/dist/victory-chart-renderer-linux-x64 |
| 46 | + |
| 47 | + - name: Upload victory-chart-renderer Linux x64 artifact |
| 48 | + # v6 |
| 49 | + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f |
| 50 | + with: |
| 51 | + name: victory-chart-renderer-linux-x64-artifact |
| 52 | + path: server/victory-chart-renderer/dist/victory-chart-renderer-linux-x64 |
| 53 | + |
| 54 | + - name: Log victory-chart-renderer build failure |
| 55 | + if: failure() || cancelled() |
| 56 | + run: | |
| 57 | + 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." |
| 58 | +
|
| 59 | + - name: Announce victory-chart-renderer build failure in Slack |
| 60 | + if: failure() || cancelled() |
| 61 | + # v3 |
| 62 | + uses: 8398a7/action-slack@1750b5085f3ec60384090fb7c52965ef822e869e |
| 63 | + with: |
| 64 | + status: custom |
| 65 | + custom_payload: | |
| 66 | + { |
| 67 | + channel: '#announce', |
| 68 | + attachments: [{ |
| 69 | + color: 'warning', |
| 70 | + text: `⚠️ ${process.env.AS_REPO} <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|victory-chart-renderer build> failed for deploy release <https://github.com/Expensify/App/releases/tag/${{ inputs.release-tag }}|${{ inputs.release-tag }}>. victory-chart-renderer-linux-x64 will not be attached.`, |
| 71 | + }] |
| 72 | + } |
| 73 | + env: |
| 74 | + GITHUB_TOKEN: ${{ github.token }} |
| 75 | + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} |
0 commit comments