-
Notifications
You must be signed in to change notification settings - Fork 238
70 lines (57 loc) · 1.9 KB
/
publish-prisma-schema-wasm.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
name: Build and publish @prisma/prisma-schema-wasm
concurrency: build-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@v3
with:
ref: ${{ github.event.inputs.enginesHash }}
- uses: cachix/install-nix-action@v22
#
# Build
#
- run: nix build .#prisma-schema-wasm
#
# Publish
#
- uses: actions/setup-node@v3
with:
node-version: "14.x"
- name: Set up NPM token
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- run: |
PACKAGE_DIR=$( nix run .#renderPrismaSchemaWasmPackage ${{ github.event.inputs.enginesWrapperVersion }})
npm publish "$PACKAGE_DIR" --access public --tag ${{ github.event.inputs.npmDistTag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
#
# 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/action-slack-notify@v2.2.0
env:
SLACK_TITLE: "prisma-schema-wasm publishing failed :x:"
SLACK_COLOR: "#FF0000"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WASM_FAILING }}