Skip to content

Publish main/89d54c2a997c4665c8e31bad5b4ffb16fb0ab524 commit from prisma-engines to npm package @prisma/engines-version #2373

Publish main/89d54c2a997c4665c8e31bad5b4ffb16fb0ab524 commit from prisma-engines to npm package @prisma/engines-version

Publish main/89d54c2a997c4665c8e31bad5b4ffb16fb0ab524 commit from prisma-engines to npm package @prisma/engines-version #2373

name: publish-engines
run-name: Publish ${{ github.event.client_payload.branch }}/${{ github.event.client_payload.commit }} commit from prisma-engines to npm package @prisma/engines-version
on:
repository_dispatch:
types:
- publish-engines
concurrency: publish-engines
jobs:
publish-engines:
# Do not change `name`, prisma-engines Buildkite build job depends on this name ending with the commit (<-- is that actually true?)
name: 'Publish engines-wrapper packages for prisma-engines branch ${{ github.event.client_payload.branch }} and commit ${{ github.event.client_payload.commit }}'
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Print input
env: { THE_INPUT: '${{ toJson(github.event.client_payload) }}' }
run: |
echo $THE_INPUT
- uses: actions/setup-node@v3
with:
node-version: '16'
- run: bash .github/workflows/setup.sh
env:
CI: true
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: pnpm run publish-all
id: publish_script
env:
CI: true
GITHUB_EVENT_CLIENT_PAYLOAD: ${{ toJson(github.event.client_payload) }}
- name: Workflow dispatch to prisma/prisma-engines for @prisma/prisma-schema-wasm publish to npm
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Build and publish @prisma/prisma-schema-wasm
repo: prisma/prisma-engines
token: ${{ secrets.BOT_TOKEN }}
inputs: '{ "enginesHash": "${{ github.event.client_payload.commit }}", "enginesWrapperVersion": "${{ steps.publish_script.outputs.new_prisma_version }}", "npmDistTag": "${{ steps.publish_script.outputs.npm_dist_tag }}" }'
- name: Workflow dispatch to prisma/prisma for version update
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Update Engines Version
repo: prisma/prisma
token: ${{ secrets.BOT_TOKEN }}
inputs: '{ "version": "${{ steps.publish_script.outputs.new_prisma_version }}", "npmDistTag": "${{ steps.publish_script.outputs.npm_dist_tag }}" }'
- uses: stefanzweifel/git-auto-commit-action@v4
with:
# Optional but recommended, defaults to "Apply automatic changes"
commit_message: engines commit ${{ github.event.client_payload.commit }}
# Optional commit user and author settings
commit_user_name: prisma-bot
commit_user_email: [email protected]
commit_author: prisma-bot <[email protected]>
- name: Set current job url in SLACK_FOOTER env var
if: ${{ failure() }}
run: echo "SLACK_FOOTER=<$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID|Click here to go to the job logs>" >> $GITHUB_ENV
- name: Slack Notification on Failure
if: ${{ failure() }}
uses: rtCamp/[email protected]
env:
SLACK_TITLE: 'Publishing failed :x:'
SLACK_COLOR: '#FF0000'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}