build_docker_images.yml 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. jobs:
  16. build-and-push-images:
  17. runs-on: ubuntu-22.04
  18. steps:
  19. - name: Checkout repository
  20. uses: actions/checkout@v3
  21. - name: Build and save Docker image(wasm-debug-server:${{ inputs.ver_num }}) to tar file
  22. run: |
  23. docker build -t wasm-debug-server:${{ inputs.ver_num }} .
  24. docker save -o wasm-debug-server.tar wasm-debug-server:${{ inputs.ver_num }}
  25. working-directory: test-tools/wamr-ide/WASM-Debug-Server/Docker
  26. - name: compress the tar file
  27. run: |
  28. tar czf wasm-debug-server-${{ inputs.ver_num }}.tar.gz wasm-debug-server.tar
  29. zip wasm-debug-server-${{ inputs.ver_num }}.zip wasm-debug-server.tar
  30. working-directory: test-tools/wamr-ide/WASM-Debug-Server/Docker
  31. - name: upload release tar.gz
  32. uses: actions/upload-release-asset@v1
  33. env:
  34. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  35. with:
  36. upload_url: ${{ inputs.upload_url }}
  37. asset_path: test-tools/wamr-ide/WASM-Debug-Server/Docker/wasm-debug-server-${{ inputs.ver_num }}.tar.gz
  38. asset_name: wasm-debug-server-${{ inputs.ver_num }}.tar.gz
  39. asset_content_type: application/x-gzip
  40. - name: upload release zip
  41. uses: actions/upload-release-asset@v1
  42. env:
  43. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  44. with:
  45. upload_url: ${{ inputs.upload_url }}
  46. asset_path: test-tools/wamr-ide/WASM-Debug-Server/Docker/wasm-debug-server-${{ inputs.ver_num }}.zip
  47. asset_name: wasm-debug-server-${{ inputs.ver_num }}.zip
  48. asset_content_type: application/zip
  49. - name: Build and save Docker image(wasm-toolchain:${{ inputs.ver_num }}) to tar file
  50. run: |
  51. docker build -t wasm-toolchain:${{ inputs.ver_num }} .
  52. docker save -o wasm-toolchain.tar wasm-toolchain:${{ inputs.ver_num }}
  53. working-directory: test-tools/wamr-ide/WASM-Toolchain/Docker
  54. - name: compress the tar file
  55. run: |
  56. tar czf wasm-toolchain-${{ inputs.ver_num }}.tar.gz wasm-toolchain.tar
  57. zip wasm-toolchain-${{ inputs.ver_num }}.zip wasm-toolchain.tar
  58. working-directory: test-tools/wamr-ide/WASM-Toolchain/Docker
  59. - name: upload release tar.gz
  60. uses: actions/upload-release-asset@v1
  61. env:
  62. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  63. with:
  64. upload_url: ${{ inputs.upload_url }}
  65. asset_path: test-tools/wamr-ide/WASM-Toolchain/Docker/wasm-toolchain-${{ inputs.ver_num }}.tar.gz
  66. asset_name: wasm-toolchain-${{ inputs.ver_num }}.tar.gz
  67. asset_content_type: application/x-gzip
  68. - name: upload release zip
  69. uses: actions/upload-release-asset@v1
  70. env:
  71. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  72. with:
  73. upload_url: ${{ inputs.upload_url }}
  74. asset_path: test-tools/wamr-ide/WASM-Toolchain/Docker/wasm-toolchain-${{ inputs.ver_num }}.zip
  75. asset_name: wasm-toolchain-${{ inputs.ver_num }}.zip
  76. asset_content_type: application/zip