File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -39,17 +39,23 @@ runs:
39
39
tail ${OPENAPI_FILE}
40
40
cat ${OPENAPI_FILE} | wc -l
41
41
shell: bash
42
+ # Merge the client package.json with the package.json from here, the result is written to package.json.tmp
42
43
- run : jq -s '.[0] * .[1]' ./package.json ./client/package.json | tee package.json.tmp
43
44
shell : bash
45
+ # This temp file is then used to create the new package.json
46
+ # This needs to be done in a separate step as to not read and write to the same file in one step
44
47
- run : mv package.json.tmp package.json
45
48
shell : bash
49
+ # Install dependencies
46
50
- run : pnpm install
47
51
shell : bash
52
+ # Generate the orval config by replacing the placeholders in the orval.config.ts file
48
53
- run : |
49
54
sed -i s/'ORVAL_API_NAME'/'"'${{ inputs.API_NAME }}'"'/ orval.config.ts
50
55
sed -i s/'API_TARGET_NAME'/''${{ inputs.API_TARGET_NAME }}''/ orval.config.ts
51
56
sed -i s/'API_TARGET_NAME'/${{ inputs.API_TARGET_NAME }}/ src/index.ts
52
57
shell: bash
58
+ # Run orval and tsup to build the client
53
59
- run : |
54
60
pnpm orval
55
61
pnpm build
Original file line number Diff line number Diff line change @@ -5,18 +5,22 @@ author: 'Oliver Dudgeon'
5
5
runs :
6
6
using : ' composite'
7
7
steps :
8
+ # Set the NPm token for authentication
8
9
- name : NPM Config
9
10
run : pnpm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
10
11
env :
11
12
NPM_TOKEN : ${{ env.NODE_AUTH_TOKEN }}
12
13
shell : bash
14
+ # Install semver which is ued to validate the input tag
13
15
- name : Install Semver CLI
14
16
run : pnpm i -g semver
15
17
shell : bash
18
+ # Merge the release config into the package.json
16
19
- name : Prepare package.json
17
20
run : |
18
21
jq -s '.[0] * .[1]' package.json package.release.json | tee dist/package.json
19
22
shell : bash
23
+ # Copy the required files to the dist directory which we publish
20
24
- name : Prepare Build
21
25
run : |
22
26
cp client/README.md dist/README.md
You can’t perform that action at this time.
0 commit comments