build_docker_images.yml 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. name: Create and publish Docker images
  4. on:
  5. workflow_call:
  6. inputs:
  7. upload_url:
  8. description: upload binary assets to the URL of release
  9. type: string
  10. required: true
  11. ver_num:
  12. description: a semantic version number.
  13. type: string
  14. required: true
  15. permissions:
  16. contents: read
  17. jobs:
  18. build-and-push-images:
  19. runs-on: ubuntu-22.04
  20. permissions:
  21. contents: write # for uploading release artifacts
  22. steps:
  23. - name: Checkout repository
  24. uses: actions/checkout@v6.0.1
  25. - name: Build and save Docker image(wasm-debug-server:${{ inputs.ver_num }}) to tar file
  26. run: |
  27. docker build -t wasm-debug-server:${{ inputs.ver_num }} .
  28. docker save -o wasm-debug-server.tar wasm-debug-server:${{ inputs.ver_num }}
  29. working-directory: test-tools/wamr-ide/WASM-Debug-Server/Docker
  30. - name: compress the tar file
  31. run: |
  32. tar czf wasm-debug-server-${{ inputs.ver_num }}.tar.gz wasm-debug-server.tar
  33. zip wasm-debug-server-${{ inputs.ver_num }}.zip wasm-debug-server.tar
  34. working-directory: test-tools/wamr-ide/WASM-Debug-Server/Docker
  35. - name: upload release tar.gz
  36. uses: actions/upload-release-asset@v1
  37. env:
  38. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  39. with:
  40. upload_url: ${{ inputs.upload_url }}
  41. asset_path: test-tools/wamr-ide/WASM-Debug-Server/Docker/wasm-debug-server-${{ inputs.ver_num }}.tar.gz
  42. asset_name: wasm-debug-server-${{ inputs.ver_num }}.tar.gz
  43. asset_content_type: application/x-gzip
  44. - name: upload release zip
  45. uses: actions/upload-release-asset@v1
  46. env:
  47. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  48. with:
  49. upload_url: ${{ inputs.upload_url }}
  50. asset_path: test-tools/wamr-ide/WASM-Debug-Server/Docker/wasm-debug-server-${{ inputs.ver_num }}.zip
  51. asset_name: wasm-debug-server-${{ inputs.ver_num }}.zip
  52. asset_content_type: application/zip
  53. - name: Build and save Docker image(wasm-toolchain:${{ inputs.ver_num }}) to tar file
  54. run: |
  55. docker build -t wasm-toolchain:${{ inputs.ver_num }} .
  56. docker save -o wasm-toolchain.tar wasm-toolchain:${{ inputs.ver_num }}
  57. working-directory: test-tools/wamr-ide/WASM-Toolchain/Docker
  58. - name: compress the tar file
  59. run: |
  60. tar czf wasm-toolchain-${{ inputs.ver_num }}.tar.gz wasm-toolchain.tar
  61. zip wasm-toolchain-${{ inputs.ver_num }}.zip wasm-toolchain.tar
  62. working-directory: test-tools/wamr-ide/WASM-Toolchain/Docker
  63. - name: upload release tar.gz
  64. uses: actions/upload-release-asset@v1
  65. env:
  66. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  67. with:
  68. upload_url: ${{ inputs.upload_url }}
  69. asset_path: test-tools/wamr-ide/WASM-Toolchain/Docker/wasm-toolchain-${{ inputs.ver_num }}.tar.gz
  70. asset_name: wasm-toolchain-${{ inputs.ver_num }}.tar.gz
  71. asset_content_type: application/x-gzip
  72. - name: upload release zip
  73. uses: actions/upload-release-asset@v1
  74. env:
  75. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  76. with:
  77. upload_url: ${{ inputs.upload_url }}
  78. asset_path: test-tools/wamr-ide/WASM-Toolchain/Docker/wasm-toolchain-${{ inputs.ver_num }}.zip
  79. asset_name: wasm-toolchain-${{ inputs.ver_num }}.zip
  80. asset_content_type: application/zip