action.yml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. name: 'Setup Nonka N-Gage SDK'
  2. description: 'Download and setup Nokia N-Gage SDK'
  3. inputs:
  4. path:
  5. description: 'Installation path'
  6. default: 'default'
  7. runs:
  8. using: 'composite'
  9. steps:
  10. - uses: actions/setup-python@v5
  11. with:
  12. python-version: '3.x'
  13. - name: 'Verify platform'
  14. id: calc
  15. shell: sh
  16. run: |
  17. case "${{ runner.os }}-${{ runner.arch }}" in
  18. "Windows-X86" | "Windows-X64")
  19. echo "ok!"
  20. echo "cache-key=ngage-sdk-windows" >> ${GITHUB_OUTPUT}
  21. default_install_path="C:/ngagesdk"
  22. ;;
  23. *)
  24. echo "Unsupported ${{ runner.os }}-${{ runner.arch }}"
  25. exit 1;
  26. ;;
  27. esac
  28. install_path="${{ inputs.path }}"
  29. if [ "x$install_path" = "xdefault" ]; then
  30. install_path="$default_install_path"
  31. fi
  32. echo "install-path=$install_path" >> ${GITHUB_OUTPUT}
  33. toolchain_repo="https://github.com/ngagesdk/ngage-toolchain"
  34. toolchain_branch="main"
  35. echo "toolchain-repo=${toolchain_repo}" >> ${GITHUB_OUTPUT}
  36. echo "toolchain-branch=${toolchain_branch}" >> ${GITHUB_OUTPUT}
  37. sdk_repo="https://github.com/ngagesdk/sdk"
  38. sdk_branch="main"
  39. echo "sdk-repo=${sdk_repo}" >> ${GITHUB_OUTPUT}
  40. echo "sdk-branch=${sdk_branch}" >> ${GITHUB_OUTPUT}
  41. tools_repo="https://github.com/ngagesdk/tools"
  42. tools_branch="main"
  43. echo "tools-repo=${tools_repo}" >> ${GITHUB_OUTPUT}
  44. echo "tools-branch=${tools_branch}" >> ${GITHUB_OUTPUT}
  45. extras_repo="https://github.com/ngagesdk/extras"
  46. extras_branch="main"
  47. echo "extras-repo=${extras_repo}" >> ${GITHUB_OUTPUT}
  48. echo "extras-branch=${extras_branch}" >> ${GITHUB_OUTPUT}
  49. # - name: 'Restore cached ${{ steps.calc.outputs.archive }}'
  50. # id: cache-restore
  51. # uses: actions/cache/restore@v4
  52. # with:
  53. # path: '${{ runner.temp }}'
  54. # key: ${{ steps.calc.outputs.cache-key }}
  55. - name: 'Download N-Gage SDK'
  56. # if: ${{ !steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false' }}
  57. shell: pwsh
  58. run: |
  59. Invoke-WebRequest "${{ steps.calc.outputs.toolchain-repo }}/archive/refs/heads/${{ steps.calc.outputs.toolchain-branch }}.zip" -OutFile "${{ runner.temp }}/ngage-toolchain.zip"
  60. Invoke-WebRequest "${{ steps.calc.outputs.sdk-repo }}/archive/refs/heads/${{ steps.calc.outputs.sdk-branch }}.zip" -OutFile "${{ runner.temp }}/sdk.zip"
  61. Invoke-WebRequest "${{ steps.calc.outputs.tools-repo }}/archive/refs/heads/${{ steps.calc.outputs.tools-branch }}.zip" -OutFile "${{ runner.temp }}/tools.zip"
  62. Invoke-WebRequest "${{ steps.calc.outputs.extras-repo }}/archive/refs/heads/${{ steps.calc.outputs.extras-branch }}.zip" -OutFile "${{ runner.temp }}/extras.zip"
  63. # - name: 'Cache ${{ steps.calc.outputs.archive }}'
  64. # if: ${{ !steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false' }}
  65. # uses: actions/cache/save@v4
  66. # with:
  67. # path: |
  68. # ${{ runner.temp }}/apps.zip
  69. # ${{ runner.temp }}/sdk.zip
  70. # ${{ runner.temp }}/tools.zip
  71. # key: ${{ steps.calc.outputs.cache-key }}
  72. - name: 'Extract N-Gage SDK'
  73. shell: pwsh
  74. run: |
  75. New-Item -ItemType Directory -Path "${{ steps.calc.outputs.install-path }}" -Force
  76. New-Item -ItemType Directory -Path "${{ runner.temp }}/ngage-toolchain-temp" -Force
  77. 7z "-o${{ runner.temp }}/ngage-toolchain-temp" x "${{ runner.temp }}/ngage-toolchain.zip"
  78. Move-Item -Path "${{ runner.temp }}/ngage-toolchain-temp/ngage-toolchain-${{ steps.calc.outputs.toolchain-branch }}/*" -Destination "${{ steps.calc.outputs.install-path }}"
  79. 7z "-o${{ steps.calc.outputs.install-path }}/sdk" x "${{ runner.temp }}/sdk.zip"
  80. Move-Item -Path "${{ steps.calc.outputs.install-path }}/sdk/sdk-${{ steps.calc.outputs.sdk-branch }}" -Destination "${{ steps.calc.outputs.install-path }}/sdk/sdk"
  81. 7z "-o${{ steps.calc.outputs.install-path }}/sdk" x "${{ runner.temp }}/tools.zip"
  82. Move-Item -Path "${{ steps.calc.outputs.install-path }}/sdk/tools-${{ steps.calc.outputs.tools-branch }}" -Destination "${{ steps.calc.outputs.install-path }}/sdk/tools"
  83. 7z "-o${{ steps.calc.outputs.install-path }}/sdk" x "${{ runner.temp }}/extras.zip"
  84. Move-Item -Path "${{ steps.calc.outputs.install-path }}/sdk/extras-${{ steps.calc.outputs.extras-branch }}" -Destination "${{ steps.calc.outputs.install-path }}/sdk/extras"
  85. - name: 'Set output variables'
  86. id: final
  87. shell: sh
  88. run: |
  89. echo "${{ steps.calc.outputs.install-path }}/sdk/sdk/6.1/Shared/EPOC32/gcc/bin" >> $GITHUB_PATH
  90. echo "${{ steps.calc.outputs.install-path }}/sdk/sdk/6.1/Shared/EPOC32/ngagesdk/bin" >> $GITHUB_PATH
  91. echo "NGAGESDK=${{ steps.calc.outputs.install-path }}" >> $GITHUB_ENV
  92. echo "CMAKE_TOOLCHAIN_FILE=${{ steps.calc.outputs.install-path }}/cmake/ngage-toolchain.cmake" >> $GITHUB_ENV