forked from WasmEdge/WasmEdge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: dm4 <[email protected]>
- Loading branch information
Showing
5 changed files
with
82 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: release-published | ||
|
||
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release | ||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
get_version: | ||
name: Retrieve version information | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.prep.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Get version | ||
id: prep | ||
run: | | ||
# Retrieve annotated tags. Details: https://github.com/actions/checkout/issues/290 | ||
git fetch --tags --force | ||
echo "Set version: $(git describe --match "[0-9].[0-9]*" --tag)" | ||
echo ::set-output name=version::$(git describe --match "[0-9].[0-9]*" --tag) | ||
build_docker_slim_images: | ||
name: Build DockerSlim Images | ||
needs: [get_version] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install requirements | ||
run: | | ||
curl -sL https://raw.githubusercontent.com/docker-slim/docker-slim/master/scripts/install-dockerslim.sh | sudo -E bash - | ||
- name: Prepare docker env | ||
id: docker_env | ||
run: | | ||
echo ::set-output name=docker_image::wasmedge/wasmedge:release-${{ needs.get_version.outputs.version }} | ||
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | ||
- name: Run docker-slim | ||
run: | | ||
docker-slim build \ | ||
--dockerfile Dockerfile.release \ | ||
--dockerfile-context utils/docker \ | ||
--tag ${{ steps.docker_env.outputs.docker_image }} \ | ||
--http-probe-off \ | ||
--include-bin /usr/local/bin/wasmedge \ | ||
--include-bin /usr/local/bin/wasmedgec \ | ||
--cbo-build-arg VERSION="${{ needs.get_version.outputs.version }}" \ | ||
--cbo-label org.opencontainers.image.title="${{ github.event.repository.name }}" \ | ||
--cbo-label org.opencontainers.image.description="${{ github.event.repository.description }}" \ | ||
--cbo-label org.opencontainers.image.url="${{ github.event.repository.html_url }}" \ | ||
--cbo-label org.opencontainers.image.source="${{ github.event.repository.clone_url }}" \ | ||
--cbo-label org.opencontainers.image.version="${{ needs.get_version.outputs.version }}" \ | ||
--cbo-label org.opencontainers.image.created="${{ steps.docker_env.outputs.created }}" \ | ||
--cbo-label org.opencontainers.image.revision="${{ github.sha }}" \ | ||
--cbo-label org.opencontainers.image.licenses="${{ github.event.repository.license.spdx_id }}" | ||
- name: Push to DockerHub | ||
run: | | ||
docker push ${{ steps.docker_env.outputs.docker_image }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM ubuntu:20.04 | ||
ARG VERSION | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt update && \ | ||
apt install -y curl git && \ | ||
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -p /usr/local -e all -v $VERSION | ||
|
||
WORKDIR /app | ||
CMD ["/usr/local/bin/wasmedge"] |