|
@@ -6,6 +6,10 @@ name: Create and publish Docker images
|
|
|
on:
|
|
on:
|
|
|
workflow_call:
|
|
workflow_call:
|
|
|
inputs:
|
|
inputs:
|
|
|
|
|
+ upload_url:
|
|
|
|
|
+ description: upload binary assets to the URL of release
|
|
|
|
|
+ type: string
|
|
|
|
|
+ required: true
|
|
|
ver_num:
|
|
ver_num:
|
|
|
description: a semantic version number.
|
|
description: a semantic version number.
|
|
|
type: string
|
|
type: string
|
|
@@ -14,35 +18,72 @@ on:
|
|
|
jobs:
|
|
jobs:
|
|
|
build-and-push-images:
|
|
build-and-push-images:
|
|
|
runs-on: ubuntu-22.04
|
|
runs-on: ubuntu-22.04
|
|
|
- permissions:
|
|
|
|
|
- contents: read
|
|
|
|
|
- packages: write
|
|
|
|
|
|
|
|
|
|
steps:
|
|
steps:
|
|
|
- name: Checkout repository
|
|
- name: Checkout repository
|
|
|
uses: actions/checkout@v3
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- - name: Downcase github actor
|
|
|
|
|
- id: downcase_github_actor
|
|
|
|
|
- uses: ASzc/change-string-case-action@v2
|
|
|
|
|
|
|
+ - name: Build and save Docker image(wasm-debug-server:${{ inputs.ver_num }}) to tar file
|
|
|
|
|
+ run: |
|
|
|
|
|
+ docker build -t wasm-debug-server:${{ inputs.ver_num }} .
|
|
|
|
|
+ docker save -o wasm-debug-server.tar wasm-debug-server:${{ inputs.ver_num }}
|
|
|
|
|
+ working-directory: test-tools/wamr-ide/WASM-Debug-Server/Docker
|
|
|
|
|
+
|
|
|
|
|
+ - name: compress the tar file
|
|
|
|
|
+ run: |
|
|
|
|
|
+ tar czf wasm-debug-server-${{ inputs.ver_num }}.tar.gz wasm-debug-server.tar
|
|
|
|
|
+ zip wasm-debug-server-${{ inputs.ver_num }}.zip wasm-debug-server.tar
|
|
|
|
|
+ working-directory: test-tools/wamr-ide/WASM-Debug-Server/Docker
|
|
|
|
|
+
|
|
|
|
|
+ - name: upload release tar.gz
|
|
|
|
|
+ uses: actions/upload-release-asset@v1
|
|
|
|
|
+ env:
|
|
|
|
|
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
with:
|
|
with:
|
|
|
- string: ${{ github.actor }}
|
|
|
|
|
|
|
+ upload_url: ${{ inputs.upload_url }}
|
|
|
|
|
+ asset_path: test-tools/wamr-ide/WASM-Debug-Server/Docker/wasm-debug-server-${{ inputs.ver_num }}.tar.gz
|
|
|
|
|
+ asset_name: wasm-debug-server-${{ inputs.ver_num }}.tar.gz
|
|
|
|
|
+ asset_content_type: application/x-gzip
|
|
|
|
|
|
|
|
- - name: Login to the Container registry
|
|
|
|
|
- uses: docker/login-action@v2
|
|
|
|
|
|
|
+ - name: upload release zip
|
|
|
|
|
+ uses: actions/upload-release-asset@v1
|
|
|
|
|
+ env:
|
|
|
|
|
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
with:
|
|
with:
|
|
|
- registry: ghcr.io
|
|
|
|
|
- username: ${{ steps.downcase_github_actor.outputs.lowercase }}
|
|
|
|
|
- password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
+ upload_url: ${{ inputs.upload_url }}
|
|
|
|
|
+ asset_path: test-tools/wamr-ide/WASM-Debug-Server/Docker/wasm-debug-server-${{ inputs.ver_num }}.zip
|
|
|
|
|
+ asset_name: wasm-debug-server-${{ inputs.ver_num }}.zip
|
|
|
|
|
+ asset_content_type: application/zip
|
|
|
|
|
|
|
|
- - name: Build and push Docker image(wasm-toolchain:${{ inputs.ver_num }}) to Container registry
|
|
|
|
|
|
|
+ - name: Build and save Docker image(wasm-toolchain:${{ inputs.ver_num }}) to tar file
|
|
|
run: |
|
|
run: |
|
|
|
- docker build -t ghcr.io/${{ steps.downcase_github_actor.outputs.lowercase }}/wasm-toolchain:${{ inputs.ver_num }} .
|
|
|
|
|
- docker push ghcr.io/${{ steps.downcase_github_actor.outputs.lowercase }}/wasm-toolchain:${{ inputs.ver_num }}
|
|
|
|
|
|
|
+ docker build -t wasm-toolchain:${{ inputs.ver_num }} .
|
|
|
|
|
+ docker save -o wasm-toolchain.tar wasm-toolchain:${{ inputs.ver_num }}
|
|
|
working-directory: test-tools/wamr-ide/WASM-Toolchain/Docker
|
|
working-directory: test-tools/wamr-ide/WASM-Toolchain/Docker
|
|
|
|
|
|
|
|
- - name: Build and push Docker image(wasm-debug-server:${{ inputs.ver_num }}) to Container registry
|
|
|
|
|
|
|
+ - name: compress the tar file
|
|
|
run: |
|
|
run: |
|
|
|
- docker build -t ghcr.io/${{ steps.downcase_github_actor.outputs.lowercase }}/wasm-debug-server:${{ inputs.ver_num }} .
|
|
|
|
|
- docker push ghcr.io/${{ steps.downcase_github_actor.outputs.lowercase }}/wasm-debug-server:${{ inputs.ver_num }}
|
|
|
|
|
- working-directory: test-tools/wamr-ide/WASM-Debug-Server/Docker
|
|
|
|
|
|
|
+ tar czf wasm-toolchain-${{ inputs.ver_num }}.tar.gz wasm-toolchain.tar
|
|
|
|
|
+ zip wasm-toolchain-${{ inputs.ver_num }}.zip wasm-toolchain.tar
|
|
|
|
|
+ working-directory: test-tools/wamr-ide/WASM-Toolchain/Docker
|
|
|
|
|
+
|
|
|
|
|
+ - name: upload release tar.gz
|
|
|
|
|
+ uses: actions/upload-release-asset@v1
|
|
|
|
|
+ env:
|
|
|
|
|
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
+ with:
|
|
|
|
|
+ upload_url: ${{ inputs.upload_url }}
|
|
|
|
|
+ asset_path: test-tools/wamr-ide/WASM-Toolchain/Docker/wasm-toolchain-${{ inputs.ver_num }}.tar.gz
|
|
|
|
|
+ asset_name: wasm-toolchain-${{ inputs.ver_num }}.tar.gz
|
|
|
|
|
+ asset_content_type: application/x-gzip
|
|
|
|
|
+
|
|
|
|
|
+ - name: upload release zip
|
|
|
|
|
+ uses: actions/upload-release-asset@v1
|
|
|
|
|
+ env:
|
|
|
|
|
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
+ with:
|
|
|
|
|
+ upload_url: ${{ inputs.upload_url }}
|
|
|
|
|
+ asset_path: test-tools/wamr-ide/WASM-Toolchain/Docker/wasm-toolchain-${{ inputs.ver_num }}.zip
|
|
|
|
|
+ asset_name: wasm-toolchain-${{ inputs.ver_num }}.zip
|
|
|
|
|
+ asset_content_type: application/zip
|
|
|
|
|
+
|