-
Notifications
You must be signed in to change notification settings - Fork 27
52 lines (43 loc) · 1.56 KB
/
definitionsBuilder.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
name: Definitions Builder
on:
workflow_dispatch:
repository_dispatch:
types: [serverless-released]
jobs:
generateTSDefinitions:
name: Generate serverless/serverless typescript definitions
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Node.js and npm
uses: actions/setup-node@v1
with:
node-version: 14.x
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: npm i
- name: Build plugin
run: npm run build
- id: serverless-version
name: Set Serverless latest version
run: echo "::set-output name=version::$(npm list serverless | grep serverless@ | sed 's/.*serverless@/v/g' | tr -d '[[:space:]]')"
- name: Generate definitions
run: npx sls schema
- name: Update package.json version
run: npm version ${{ steps.serverless-version.outputs.version }} --git-tag-version=false
- name: Commit changes
uses: EndBug/add-and-commit@v5
with:
author_name: Frédéric Barthelet
author_email: [email protected]
branch: master
message: Add Serverless definitions for ${{ steps.serverless-version.outputs.version }}
add: index.d.ts package.json
tag: ${{ steps.serverless-version.outputs.version }} --force
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}