|
| 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 |
0 commit comments