Skip to content

Commit b45fd07

Browse files
committed
feat(cli): variadic parameters
1 parent 64da40c commit b45fd07

File tree

17 files changed

+363
-607
lines changed

17 files changed

+363
-607
lines changed

.github/actions/restore-all/action.yml

Lines changed: 0 additions & 242 deletions
This file was deleted.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Restore artifacts
2+
3+
description: |
4+
When no input is given, artifacts are restored in the current directory, under their artifact `name`.
5+
6+
This composite restore all of our artifacts, at their right path.
7+
8+
inputs:
9+
type:
10+
description: Type of artifacts to restore (`all` | `specs` | `javascript` | `js-utils` | `java` | `php`)
11+
required: false
12+
specific:
13+
description: Only restore a specific artifact if true.
14+
required: false
15+
16+
runs:
17+
using: composite
18+
steps:
19+
# Bundled specs
20+
- name: specs
21+
if: ${{ inputs.type == 'all' || inputs.type == 'specs' }}
22+
uses: actions/download-artifact@v3
23+
with:
24+
name: specs
25+
path: specs/bundled/
26+
27+
# Common
28+
- name: Download clients-${{ inputs.type }} artifact
29+
if: ${{ inputs.specific && inputs.type }}
30+
uses: actions/download-artifact@v3
31+
with:
32+
name: clients-${{ inputs.type }}
33+
34+
- name: Unzip clients-${{ inputs.type }} artifact
35+
if: ${{ inputs.specific && inputs.type }}
36+
shell: bash
37+
run: unzip -q -o clients-${{ inputs.type }}.zip
38+
39+
# JavaScript utils
40+
- name: client-javascript-utils-client-common
41+
if: ${{ inputs.type == 'all' || inputs.type == 'utils' }}
42+
uses: actions/download-artifact@v3
43+
with:
44+
name: client-javascript-utils-client-common
45+
path: clients/algoliasearch-client-javascript/packages/client-common/
46+
47+
- name: client-javascript-utils-requester-browser-xhr
48+
if: ${{ inputs.type == 'all' || inputs.type == 'utils' }}
49+
uses: actions/download-artifact@v3
50+
with:
51+
name: client-javascript-utils-requester-browser-xhr
52+
path: clients/algoliasearch-client-javascript/packages/requester-browser-xhr/
53+
54+
- name: client-javascript-utils-requester-node-http
55+
if: ${{ inputs.type == 'all' || inputs.type == 'utils' }}
56+
uses: actions/download-artifact@v3
57+
with:
58+
name: client-javascript-utils-requester-node-http
59+
path: clients/algoliasearch-client-javascript/packages/requester-node-http/
60+
61+
# JavaScript
62+
- name: Download clients-javascript artifact
63+
if: ${{ inputs.type == 'all' }}
64+
uses: actions/download-artifact@v3
65+
with:
66+
name: clients-javascript
67+
68+
- name: Unzip clients-javascript artifact
69+
if: ${{ inputs.type == 'all' }}
70+
shell: bash
71+
run: unzip -q -o clients-javascript.zip
72+
73+
# PHP
74+
- name: Download clients-php artifact
75+
if: ${{ inputs.type == 'all' }}
76+
uses: actions/download-artifact@v3
77+
with:
78+
name: clients-php
79+
80+
- name: Unzip clients-php artifact
81+
if: ${{ inputs.type == 'all' }}
82+
shell: bash
83+
run: unzip -q -o clients-php.zip
84+
85+
# Java
86+
- name: Download clients-java artifact
87+
if: ${{ inputs.type == 'all' }}
88+
uses: actions/download-artifact@v3
89+
with:
90+
name: clients-java
91+
92+
- name: Unzip clients-java artifact
93+
if: ${{ inputs.type == 'all' }}
94+
shell: bash
95+
run: unzip -q -o clients-java.zip

.github/actions/setup/action.yml

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -111,26 +111,12 @@ outputs:
111111
description: The generated `specs` matrix
112112
value: ${{ steps.spec-matrix.outputs.MATRIX }}
113113

114-
RUN_JAVASCRIPT:
115-
description: Determine if the `client_javascript` job should run
116-
value: ${{ steps.gen-matrix.outputs.RUN_JAVASCRIPT }}
117-
JAVASCRIPT_MATRIX:
118-
description: The generated `client_javascript` matrix
119-
value: ${{ steps.gen-matrix.outputs.JAVASCRIPT_MATRIX }}
120-
121-
RUN_JAVA:
122-
description: Determine if the `client_java` job should run
123-
value: ${{ steps.gen-matrix.outputs.RUN_JAVA }}
124-
JAVA_MATRIX:
125-
description: The generated `client_java` matrix
126-
value: ${{ steps.gen-matrix.outputs.JAVA_MATRIX }}
127-
128-
RUN_PHP:
129-
description: Determine if the `client_php` job should run
130-
value: ${{ steps.gen-matrix.outputs.RUN_PHP }}
131-
PHP_MATRIX:
132-
description: The generated `client_php` matrix
133-
value: ${{ steps.gen-matrix.outputs.PHP_MATRIX }}
114+
RUN_GEN:
115+
description: Determine if the `client_gen` job should run
116+
value: ${{ steps.gen-matrix.outputs.RUN_GEN }}
117+
GEN_MATRIX:
118+
description: The generated `client_gen` matrix
119+
value: ${{ steps.gen-matrix.outputs.GEN_MATRIX }}
134120

135121
RUN_JS_ALGOLIASEARCH:
136122
description: Determine if the `client-javascript-algoliasearch` job should run
@@ -153,11 +139,12 @@ outputs:
153139
steps.diff.outputs.JS_TEMPLATE_CHANGED > 0 ||
154140
steps.diff.outputs.JAVA_CLIENT_CHANGED > 0 ||
155141
steps.diff.outputs.JAVA_TEMPLATE_CHANGED > 0 }}
142+
CTS_MATRIX:
143+
description: The generated `cts` matrix
144+
value: ${{ steps.gen-matrix.outputs.CTS_MATRIX }}
156145

157146
RUN_CODEGEN:
158147
description: Determine if the `codegen` job should run
159148
value: ${{
160149
steps.spec-matrix.outputs.RUN_SPECS == 'true' ||
161-
steps.gen-matrix.outputs.RUN_JAVASCRIPT == 'true' ||
162-
steps.gen-matrix.outputs.RUN_JAVA == 'true' ||
163-
steps.gen-matrix.outputs.RUN_PHP == 'true' }}
150+
steps.gen-matrix.outputs.RUN_GEN == 'true' }}

0 commit comments

Comments
 (0)