-
Notifications
You must be signed in to change notification settings - Fork 1.5k
74 lines (65 loc) · 3.68 KB
/
update-engines-version.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Update Engines Version
on:
workflow_dispatch:
inputs:
version:
description: "Version to check and update the engines version"
required: true
jobs:
update_engines:
name: "Check and update @prisma/engines@${{ github.event.inputs.version }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
- uses: pnpm/action-setup@v2.0.1
with:
version: 6.9.1
# This step uses `@prisma/ensure-npm-release` (abbv. `enr`) https://github.com/prisma/ensure-npm-release
- name: Check if version is available on npm
run: |
echo 'Checking that all packages [@prisma/engines, @prisma/engines-version, @prisma/fetch-engine, @prisma/get-platform] have the published version @${{ github.event.inputs.version }}'
pnpx -y -p @prisma/ensure-npm-release enr update -p @prisma/engines -u ${{ github.event.inputs.version }}
pnpx -y -p @prisma/ensure-npm-release enr update -p @prisma/engines-version -u ${{ github.event.inputs.version }}
pnpx -y -p @prisma/ensure-npm-release enr update -p @prisma/fetch-engine -u ${{ github.event.inputs.version }}
pnpx -y -p @prisma/ensure-npm-release enr update -p @prisma/get-platform -u ${{ github.event.inputs.version }}
echo 'Awesome - proceeding to make the PR'
- name: Update the engines dependencies
run: |
echo 'Updating @prisma/engines, @prisma/engines-version, @prisma/fetch-engine and @prisma/get-platform to ${{ github.event.inputs.version }} using pnpm'
cd src
pnpm update -r @prisma/engines@${{ github.event.inputs.version }} @prisma/engines-version@${{ github.event.inputs.version }} @prisma/fetch-engine@${{ github.event.inputs.version }} @prisma/get-platform@${{ github.event.inputs.version }}
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.BOT_TOKEN }}
commit-message: "chore(deps): update engines to ${{ github.event.inputs.version }}"
committer: "Prismo <prismabots@gmail.com>"
author: "Prismo <prismabots@gmail.com>"
branch: deps/engines-${{ github.event.inputs.version }}
delete-branch: true
labels: automerge
title: "chore(deps): update engines to ${{ github.event.inputs.version }}"
body: |
This automatic PR updates the engines to version `${{ github.event.inputs.version }}`. This will get automatically merged if all the tests pass.
## Packages:
| Package | NPM URL |
|---------|---------|
|`@prisma/engines`| https://npmjs.com/package/@prisma/engines/v/${{ github.event.inputs.version }}|
|`@prisma/engines-version`| https://npmjs.com/package/@prisma/engines-version/v/${{ github.event.inputs.version }}|
|`@prisma/fetch-engine`| https://npmjs.com/package/@prisma/fetch-engine/v/${{ github.event.inputs.version }}|
|`@prisma/get-platform`| https://npmjs.com/package/@prisma/get-platform/v/${{ github.event.inputs.version }}|
- name: PR url
run: |
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
- name: Sleep for 5 seconds
run: sleep 5s
shell: bash
- name: Auto approve Pull Request (to trigger automerge if tests passing)
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: juliangruber/approve-pull-request-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.cpr.outputs.pull-request-number }}