forked from apimatic/apimatic-js-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (148 loc) · 7.48 KB
/
main.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Publish npm packages
on:
workflow_dispatch:
inputs:
authentication-adapters-version:
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version"
required: false
axios-client-adapter-version:
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version"
required: false
convert-to-stream-version:
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version"
required: false
core-version:
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version"
required: false
core-interfaces-version:
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version"
required: false
file-wrapper-version:
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version"
required: false
http-headers-version:
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version"
required: false
http-query-version:
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version"
required: false
oauth-adapters-version:
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version"
required: false
schema-version:
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version"
required: false
# xml-adapter-version:
# description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version"
# required: false
jobs:
build:
name: Publish package
runs-on: ubuntu-latest
steps:
# - name: Package version validation
# if: ${{ github.event.inputs.authentication-adapters-version == '' &&
# github.event.inputs.axios-client-adapter-version == '' &&
# github.event.inputs.convert-to-stream-version == '' &&
# github.event.inputs.core-version == '' &&
# github.event.inputs.core-interfaces-version == '' &&
# github.event.inputs.file-wrapper-version == '' &&
# github.event.inputs.http-headers-version == '' &&
# github.event.inputs.http-query-version == '' &&
# github.event.inputs.oauth-adapters-version == '' &&
# github.event.inputs.schema-version == '' &&
# github.event.inputs.xml-adapter-version == '' }}
# run: |
# echo "No version values provided"
# exit 1
- name: Checkout repo
uses: actions/checkout@v2
- name: Use Node 19.x
uses: actions/setup-node@v1
with:
node-version: "19.x"
- name: Create and switch to new branch
run: |
git checkout -b release-npm-packages
- name: Bump authentication-adapters package version
if: "${{ github.event.inputs.authentication-adapters-version != '' }}"
run: |
cd packages/authentication-adapters
../../node_modules/.bin/lerna version ${{ github.event.inputs.authentication-adapters-version }}
# - name: Bump axios-client-adapter package version
# if: "${{ github.event.inputs.axios-client-adapter-version != '' }}"
# run: |
# cd packages/axios-client-adapter
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.axios-client-adapter-version }}
# - name: Bump convert-to-stream package version
# if: "${{ github.event.inputs.convert-to-stream-version != '' }}"
# run: |
# cd packages/convert-to-stream
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.convert-to-stream-version }}
# - name: Bump core package version
# if: "${{ github.event.inputs.core-version != '' }}"
# run: |
# cd packages/core
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.core-version }}
# - name: Bump core-interfaces package version
# if: "${{ github.event.inputs.core-interfaces-version != '' }}"
# run: |
# cd packages/core-interfaces
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.core-interfaces-version }}
# - name: Bump file-wrapper package version
# if: "${{ github.event.inputs.file-wrapper-version != '' }}"
# run: |
# cd packages/file-wrapper
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.file-wrapper-version }}
# - name: Bump http-headers package version
# if: "${{ github.event.inputs.http-headers-version != '' }}"
# run: |
# cd packages/http-headers
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.http-headers-version }}
# - name: Bump http-query package version
# if: "${{ github.event.inputs.http-query-version != '' }}"
# run: |
# cd packages/http-query
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.http-query-version }}
# - name: Bump oauth-adapters package version
# if: "${{ github.event.inputs.oauth-adapters-version != '' }}"
# run: |
# cd packages/oauth-adapters
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.oauth-adapters-version }}
# - name: Bump schema package version
# if: "${{ github.event.inputs.schema-version != '' }}"
# run: |
# cd packages/schema
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.schema-version }}
# - name: Bump xml-adapter package version
# if: "${{ github.event.inputs.xml-adapter-version != '' }}"
# run: |
# cd packages/xml-adapter
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.xml-adapter-version }}
- name: Commit and push
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "ci: bump package version"
- name: Install dependencies and build
run: |
yarn install --frozen-lockfile
yarn build
# - name: Create Pull Request
# uses: peter-evans/create-pull-request@v3
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# commit-message: "Automated PR creation for bumping package versions"
# title: "Changes from action"
# body: |
# This PR was automatically created by a GitHub Action for bumping package versions.
# branch: release-npm-packages
# - name: NPM Identity
# env:
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: |
# echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
# - name: Publish Packages
# run: |
# ./node_modules/.bin/lerna publish from-package --registry https://registry.npmjs.org/ --yes
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}