-
Notifications
You must be signed in to change notification settings - Fork 3
46 lines (44 loc) · 1.29 KB
/
publish.yml
File metadata and controls
46 lines (44 loc) · 1.29 KB
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
name: Publish
on:
workflow_dispatch:
inputs:
version_directory:
description: 'API version directory to publish from'
required: true
type: choice
options:
- v20111101
- v20250224
workflow_call:
inputs:
version_directory:
description: 'API version directory to publish from'
required: true
type: string
jobs:
Publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- name: Install and Publish
working-directory: ./${{ inputs.version_directory }}
run: |
npm install
npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
- name: Slack notification
uses: ravsamhq/notify-slack-action@v2
if: always()
with:
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: "{repo}: {workflow} workflow"
message_format: "{emoji} *<{workflow_url}|{workflow}>* {status_message} in <{repo_url}|{repo}>"
notify_when: "failure"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}