|
| 1 | +name: "Create native bundle" |
| 2 | +description: "Create a native bundle for android / iOS" |
| 3 | +inputs: |
| 4 | + platform: |
| 5 | + description: "Target platform (android or ios)" |
| 6 | + required: true |
| 7 | + mda-file: |
| 8 | + description: "Path to the deployment package" |
| 9 | + required: true |
| 10 | +runs: |
| 11 | + using: composite |
| 12 | + steps: |
| 13 | + - name: "Make sure curl is installed" |
| 14 | + run: | |
| 15 | + apt update && apt upgrade -y |
| 16 | + apt install curl -y |
| 17 | + shell: bash |
| 18 | + - name: "Download test project" |
| 19 | + run: curl -L -o project.zip https://github.com/mendix/Native-Mobile-Resources/archive/refs/heads/main.zip |
| 20 | + shell: bash |
| 21 | + - name: "Extract test project" |
| 22 | + uses: montudor/action-zip@v1.0.0 |
| 23 | + with: |
| 24 | + args: unzip -qq project.zip |
| 25 | + - name: "Extract deployment package" |
| 26 | + uses: montudor/action-zip@v1.0.0 |
| 27 | + with: |
| 28 | + args: unzip -qq ${{ inputs.mda-file }} -d Native-Mobile-Resources-main/deployment |
| 29 | + - name: "Create bundle for ${{ inputs.platform }}" |
| 30 | + run: | |
| 31 | + mkdir -p ${{ inputs.platform }}/assets |
| 32 | + cd Native-Mobile-Resources-main/deployment/native && \ |
| 33 | + /tmp/mxbuild/modeler/tools/node/linux-x64/node \ |
| 34 | + /tmp/mxbuild/modeler/tools/node/node_modules/react-native/local-cli/cli.js \ |
| 35 | + bundle --verbose --platform ${{ inputs.platform }} --dev false \ |
| 36 | + --config "$PWD/metro.config.json" \ |
| 37 | + --bundle-output $GITHUB_WORKSPACE/${{ inputs.platform }}/index.${{ inputs.platform }}.bundle \ |
| 38 | + --assets-dest $GITHUB_WORKSPACE/${{ inputs.platform }}/assets/ \ |
| 39 | + --entry-file ./index.js |
| 40 | + shell: bash |
| 41 | + env: |
| 42 | + NODE_OPTIONS: --max_old_space_size=6144 |
| 43 | + - name: "Upload bundle for ${{ inputs.platform }}" |
| 44 | + uses: actions/upload-artifact@v3.1.2 |
| 45 | + with: |
| 46 | + name: ${{ inputs.platform }}-bundle |
| 47 | + path: ${{ inputs.platform }} |
0 commit comments