@@ -2,56 +2,44 @@ name: 'SimpleLocalize'
22description : ' Manage localization files with SimpleLocalize Github Action'
33author : " SimpleLocalize"
44branding :
5- icon : ' download-cloud '
5+ icon : ' globe '
66 color : ' blue'
77inputs :
88 command :
9- description : ' Choose a command'
9+ description : ' Choose a CLI command to execute. Commands: https://simplelocalize.io/docs/cli/get-started/ '
1010 required : true
1111 default : ' status'
1212 cli-version :
13- description : ' Choose a command '
13+ description : ' Choose a CLI version. Versions: https://github.com/simplelocalize/simplelocalize-cli/releases '
1414 required : true
15- default : ' status '
15+ default : ' 2.2.0 '
1616 api-key :
1717 description : ' Project API Key'
1818 required : false
19- default : ' '
2019 download-path :
21- description : ' Where files should be downloaded'
20+ description : ' Where files should be downloaded, e.g.: ./i18n/messages.json, ./i18n/messages/{lang}.json, ./i18n/messages/{lang}/{ns}.json '
2221 required : false
23- default : ' ./messages.json'
2422 download-format :
25- description : ' Choose a localization files format'
26- required : false
27- default : ' multi-language-json'
28- download-options :
29- description : ' Choose additional download options'
23+ description : ' Choose a localization files format. Formats: https://simplelocalize.io/docs/general/file-formats/'
3024 required : false
31- default : ' '
3225 upload-path :
33- description : ' Which files should be uploaded'
26+ description : ' Which files should be uploaded, e.g.: ./i18n/messages.json, ./i18n/messages/{lang}.json, ./i18n/messages/{lang}/{ns}.json '
3427 required : false
35- default : ' ./messages.json'
3628 upload-format :
37- description : ' Choose a localization files format'
38- required : false
39- default : ' multi-language-json'
40- upload-options :
41- description : ' Choose additional upload options'
29+ description : ' Choose a localization files format. Formats: https://simplelocalize.io/docs/general/file-formats/'
4230 required : false
43- default : ' '
44- customer-ids :
45- description : ' Download translations for given customerIds'
46- required : false
47- default : ' '
4831 args :
49- description : ' Additional arguments'
32+ description : ' Custom arguments for the CLI command '
5033 required : false
5134 default : ' '
5235runs :
5336 using : ' composite'
5437 steps :
38+ - name : " Setup Java"
39+ uses : actions/setup-java@v3
40+ with :
41+ distribution : ' temurin'
42+ java-version : ' 20'
5543 - name : " Print inputs"
5644 run : |
5745 echo "Test SimpleLocalize"
@@ -68,16 +56,19 @@ runs:
6856 echo "upload-format: ${{ inputs.upload-format }}"
6957 echo "args: ${{ inputs.args }}"
7058 shell : bash
71- - name : " Setup Java"
72- uses : actions/setup-java@v3
73- with :
74- distribution : ' temurin'
75- java-version : ' 20'
7659 - name : " Download SimpleLocalize CLI"
7760 run : " curl -o simplelocalize.jar https://get.simplelocalize.io/binaries/${{ inputs.cli-version }}/simplelocalize-cli-${{ inputs.cli-version }}.jar"
7861 shell : bash
7962 - name : " Execute SimpleLocalize CLI Command"
8063 run : |
64+ if [[ "${{ inputs.command }}" = "download" ]]
65+ then
66+ java -jar simplelocalize.jar ${{ inputs.command }} ${{ inputs.args }} --download-path ${{ inputs.download-path }} --download-format ${{ inputs.download-format }}
67+ elif [[ "${{ inputs.command }}" = "upload" ]]
68+ then
69+ java -jar simplelocalize.jar ${{ inputs.command }} ${{ inputs.args }} --upload-path ${{ inputs.upload-path }} --upload-format ${{ inputs.upload-format }}
70+ else
8171 java -jar simplelocalize.jar ${{ inputs.command }} ${{ inputs.args }}
72+ fi
8273 shell : bash
8374
0 commit comments