Skip to content

npm - release 5.4.1 from 5.4.x on latest tag #7

npm - release 5.4.1 from 5.4.x on latest tag

npm - release 5.4.1 from 5.4.x on latest tag #7

name: npm - release to latest
run-name: npm - release ${{ github.event.inputs.targetVersion }} from ${{ github.ref_name }} on latest tag
on:
workflow_dispatch:
inputs:
targetVersion:
description: 'Version to publish on latest tag (e.g. 5.0.0)'
type: string
required: true
skipEcosystemTestsChecks:
description: 'Skip ecosystem tests checks'
type: boolean
skipPackages:
description: 'Skip publishing some packages? (e.g. `@prisma/debug,@prisma/internals`)'
type: string
required: false
onlyPackages:
description: 'Only publish some packages? (e.g. `@prisma/debug,@prisma/internals`)'
type: string
required: false
dryRun:
description: 'Check to do a dry run (does not publish packages)'
type: boolean
env:
# To hide "Update available 0.0.0 -> x.x.x"
PRISMA_HIDE_UPDATE_MESSAGE: 'true'
jobs:
release:
timeout-minutes: 45
# environment: 'npm-latest'
runs-on: ubuntu-latest
permissions:
# required for publishing to npm with --provenance
# see https://docs.npmjs.com/generating-provenance-statements
id-token: write
steps:
- name: Print input
env:
THE_INPUT: '${{ toJson(github.event.inputs) }}'
run: |
echo $THE_INPUT
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
node-version: 16
pnpm-version: 8
skip-tsc: false
- name: Publish all packages to npm
id: publish
run: |
echo "BUILDKITE_TAG $BUILDKITE_TAG"
echo "SKIP_ECOSYSTEMTESTS_CHECK $SKIP_ECOSYSTEMTESTS_CHECK"
pnpm run publish-all
env:
# Inputs
BUILDKITE_TAG: ${{ github.event.inputs.targetVersion }}
SKIP_ECOSYSTEMTESTS_CHECK: ${{ github.event.inputs.skipEcosystemTestsChecks }}
ONLY_PACKAGES: ${{ github.event.inputs.onlyPackages }}
SKIP_PACKAGES: ${{ github.event.inputs.skipPackages }}
DRY_RUN: ${{ github.event.inputs.dryRun == 'true' && 'true' || '' }}
# Other
BUILDKITE: true
BUILDKITE_BRANCH: ${{ github.ref_name }}
GITHUB_CONTEXT: ${{ toJson(github) }}
# https://docs.npmjs.com/generating-provenance-statements
NPM_CONFIG_PROVENANCE: true
# Secrets
# Note: must use personal access token
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
REDIS_URL: ${{ secrets.REDIS_URL }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
SLACK_RELEASE_FEED_WEBHOOK: ${{ secrets.SLACK_RELEASE_FEED_WEBHOOK }}
- name: Print output
env:
THE_OUTPUT: '${{ toJson(steps.publish.outputs) }}'
run: |
echo $THE_OUTPUT
# We also have `sendSlackMessage()` in publish.ts
# It uses the #feed-prisma-releases channel and adds more information
success:
needs:
- release
if: ${{ success() }}
name: Communicate success
runs-on: ubuntu-latest
steps:
- name: Set current job url in SLACK_FOOTER env var
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 Success
uses: rtCamp/action-slack-notify@v2.2.1
env:
SLACK_TITLE: 'prisma/prisma Release ${{ steps.publish.outputs.prismaVersion }} succeeded :white_check_mark:'
SLACK_COLOR: '#55ff55'
SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASE_FEED_WEBHOOK }}
SLACK_CHANNEL: feed-prisma-publish
failure:
needs:
- release
if: ${{ failure() }}
name: Communicate failure
runs-on: ubuntu-latest
steps:
- name: Set current job url in SLACK_FOOTER env var
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
uses: rtCamp/action-slack-notify@v2.2.1
env:
SLACK_TITLE: 'prisma/prisma Release ${{ github.event.inputs.targetVersion }} from ${{ github.ref_name }} on latest tag failed :x:'
SLACK_COLOR: '#FF0000'
SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASE_FEED_WEBHOOK }}
SLACK_CHANNEL: feed-prisma-publish-failures