From 9094b6ce2a62642cc0f82443118e628c3ced7c33 Mon Sep 17 00:00:00 2001 From: Yindong Xiao Date: Sun, 16 Apr 2023 00:48:40 +0800 Subject: [PATCH 1/3] generate images that support template compiling. --- .github/Dockerfile | 10 +++++++++ .github/workflows/docker.yml | 43 ++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .github/Dockerfile create mode 100644 .github/workflows/docker.yml diff --git a/.github/Dockerfile b/.github/Dockerfile new file mode 100644 index 0000000..54d125e --- /dev/null +++ b/.github/Dockerfile @@ -0,0 +1,10 @@ +FROM ghcr.io/readon/spinalhdl:master + +ARG JAVA_EXTRA_OPTS="-Xmx2g -Xms2g" +ENV JAVA_OPTS="${JAVA_OPTS} ${JAVA_EXTRA_OPTS}" +RUN https://github.com/SpinalHDL/SpinalTemplateSbt.git && \ + cd SpinalTemplateSbt && \ + git submodule update --init --recursive && \ + sbt compile && \ + mill _.compile && \ + cd .. && rm -rf SpinalTemplateSbt diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..5cdebdb --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,43 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - master + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Log in to the Container registry + uses: docker/login-action@v1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + file: .github/Dockerfile + push: true + labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta.outputs.tags }} \ No newline at end of file From a6773349ee6236ae9b4e93f33b2db2f6d84b31c9 Mon Sep 17 00:00:00 2001 From: Yindong Xiao Date: Sun, 16 Apr 2023 00:49:05 +0800 Subject: [PATCH 2/3] use mill the same version as spinalhdl. --- .mill-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mill-version b/.mill-version index e3e1807..f314d02 100644 --- a/.mill-version +++ b/.mill-version @@ -1 +1 @@ -0.9.8 +0.10.9 From aef775ddf112c086a961dbd1e267be8e612a8565 Mon Sep 17 00:00:00 2001 From: Yindong Xiao Date: Sun, 16 Apr 2023 00:52:24 +0800 Subject: [PATCH 3/3] fix missing command of git clone. --- .github/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/Dockerfile b/.github/Dockerfile index 54d125e..625a8f8 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -2,7 +2,7 @@ FROM ghcr.io/readon/spinalhdl:master ARG JAVA_EXTRA_OPTS="-Xmx2g -Xms2g" ENV JAVA_OPTS="${JAVA_OPTS} ${JAVA_EXTRA_OPTS}" -RUN https://github.com/SpinalHDL/SpinalTemplateSbt.git && \ +RUN git clone https://github.com/SpinalHDL/SpinalTemplateSbt.git && \ cd SpinalTemplateSbt && \ git submodule update --init --recursive && \ sbt compile && \