npm - release @prisma/prisma-schema-wasm@5.7.0-2.4d2e0085c118702f881d6e8b0ec0b9a5498fa6e3 from 4d2e0085c118702f881d6e8b0ec0b9a5498fa6e3 on latest #214
This file contains 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
name: Build and publish @prisma/prisma-schema-wasm | |
run-name: npm - release @prisma/prisma-schema-wasm@${{ github.event.inputs.enginesWrapperVersion }} from ${{ github.event.inputs.enginesHash }} on ${{ github.event.inputs.npmDistTag }} | |
concurrency: publish-prisma-schema-wasm | |
on: | |
# usually triggered via GH Actions Workflow in prisma/engines-wrapper repo | |
workflow_dispatch: | |
inputs: | |
enginesWrapperVersion: | |
required: true | |
enginesHash: | |
required: true | |
npmDistTag: | |
required: true | |
default: 'latest' | |
jobs: | |
build: | |
name: Build and publish @prisma/prisma-schema-wasm | |
runs-on: ubuntu-latest | |
steps: | |
- name: Print input | |
env: | |
THE_INPUT: '${{ toJson(github.event.inputs) }}' | |
run: | | |
echo $THE_INPUT | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.enginesHash }} | |
- uses: cachix/install-nix-action@v23 | |
- name: Build | |
run: nix build .#prisma-schema-wasm | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
# This is needed to be done manually because of `PACKAGE_DIR` used later | |
- name: Set up NPM token for publishing later | |
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | |
- name: Update version in package.json & Publish @prisma/prisma-schema-wasm | |
run: | | |
# Update version in package.json and return directory for later usage | |
PACKAGE_DIR=$( nix run .#renderPrismaSchemaWasmPackage ${{ github.event.inputs.enginesWrapperVersion }}) | |
npm publish "$PACKAGE_DIR" --access public --tag ${{ github.event.inputs.npmDistTag }} | |
# | |
# Failure handlers | |
# | |
- 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: 'prisma-schema-wasm publishing failed :x:' | |
SLACK_COLOR: '#FF0000' | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WASM_FAILING }} |