mirror of
https://github.com/LIV2/container-amiga-godbolt.git
synced 2025-12-06 00:32:47 +00:00
Initial commit.
This commit is contained in:
commit
78aef6ca1a
107
.github/workflows/build.yml
vendored
Normal file
107
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,107 @@
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "Build-**"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-24.04-arm
|
||||
platform: arm64
|
||||
- os: ubuntu-24.04
|
||||
platform: amd64
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Prepare
|
||||
run: |
|
||||
platform=${{ matrix.platform }}
|
||||
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
${{ vars.DOCKERHUB_REPO }}
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push by digest
|
||||
id: build
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
platforms: "${{ matrix.platform }}"
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
outputs: type=image,"name=${{ vars.DOCKERHUB_REPO }}",push-by-digest=true,name-canonical=true,push=true
|
||||
|
||||
- name: Export digest
|
||||
run: |
|
||||
mkdir -p ${{ runner.temp }}/digests
|
||||
digest="${{ steps.build.outputs.digest }}"
|
||||
touch "${{ runner.temp }}/digests/${digest#sha256:}"
|
||||
|
||||
- name: Upload digest
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: digests-${{ env.PLATFORM_PAIR }}
|
||||
path: ${{ runner.temp }}/digests/*
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
merge:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build
|
||||
steps:
|
||||
- name: Download digests
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ${{ runner.temp }}/digests
|
||||
pattern: digests-*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
${{ vars.DOCKERHUB_REPO }}
|
||||
tags: |
|
||||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
|
||||
type=sha
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
|
||||
- name: Create manifest list and push
|
||||
working-directory: ${{ runner.temp }}/digests
|
||||
run: |
|
||||
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
||||
$(printf '${{ vars.DOCKERHUB_REPO }}@sha256:%s ' *)
|
||||
|
||||
- name: Inspect image
|
||||
run: |
|
||||
docker buildx imagetools inspect ${{ vars.DOCKERHUB_REPO }}:${{ steps.meta.outputs.version }}
|
||||
35
Dockerfile
Normal file
35
Dockerfile
Normal file
@ -0,0 +1,35 @@
|
||||
FROM liv2/amiga-gcc:latest
|
||||
|
||||
EXPOSE 10240/tcp
|
||||
|
||||
ENV EXTRA_ARGS="--language c --language c++"
|
||||
|
||||
ARG NODE_VERSION=v22.16.0
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
git \
|
||||
rsync \
|
||||
gcc \
|
||||
xz-utils \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Download and extract Node.js binary tarball
|
||||
ADD scripts/node_install.sh /node_install.sh
|
||||
RUN /node_install.sh
|
||||
|
||||
RUN mkdir /compiler-explorer && chown ubuntu:ubuntu /compiler-explorer
|
||||
|
||||
USER ubuntu
|
||||
|
||||
RUN git clone https://github.com/compiler-explorer/compiler-explorer.git
|
||||
|
||||
ADD configs/* /compiler-explorer/etc/config/
|
||||
|
||||
WORKDIR /compiler-explorer
|
||||
|
||||
RUN make prebuild
|
||||
|
||||
CMD [ "make" ]
|
||||
8
configs/c++.local.properties
Normal file
8
configs/c++.local.properties
Normal file
@ -0,0 +1,8 @@
|
||||
compilers=amigagpp
|
||||
compiler.amigagpp.exe=/opt/amiga/bin/m68k-amigaos-g++
|
||||
compiler.amigagpp.name=g++-6.5.0b
|
||||
compiler.amigagpp.options=-O2 -mcpu=68000 -std=c++11
|
||||
compiler.amigagpp.supportsExecute=false
|
||||
compiler.amigagpp.demangler=/opt/amiga/bin/m68k-amigaos-c++filt
|
||||
compiler.amigagpp.objdumper=/opt/amiga/bin/m68k-amigaos-objdump
|
||||
compiler.amigagpp.nm=/opt/amiga/bin/m68k-amigaos-nm
|
||||
8
configs/c.local.properties
Normal file
8
configs/c.local.properties
Normal file
@ -0,0 +1,8 @@
|
||||
compilers=amigagcc
|
||||
compiler.amigagcc.exe=/opt/amiga/bin/m68k-amigaos-gcc
|
||||
compiler.amigagcc.name=gcc-6.5.0b
|
||||
compiler.amigagcc.options=-O2 -mcpu=68000 -std=c99
|
||||
compiler.amigagcc.supportsExecute=false
|
||||
compiler.amigagcc.demangler=/opt/amiga/bin/m68k-amigaos-c++filt
|
||||
compiler.amigagcc.objdumper=/opt/amiga/bin/m68k-amigaos-objdump
|
||||
compiler.amigagcc.nm=/opt/amiga/bin/m68k-amigaos-nm
|
||||
15
scripts/node_install.sh
Executable file
15
scripts/node_install.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
set -e -u -x
|
||||
|
||||
if [[ $(arch) == "aarch64" ]]
|
||||
then
|
||||
NODE_ARCH=arm64
|
||||
else
|
||||
NODE_ARCH=x64
|
||||
fi
|
||||
NODE_TAR=node-${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz
|
||||
NODE_URL=https://nodejs.org/dist/${NODE_VERSION}/${NODE_TAR}
|
||||
|
||||
curl -fsSL ${NODE_URL} -o /tmp/${NODE_TAR}
|
||||
tar -xJf /tmp/${NODE_TAR} -C /usr/local --strip-components=1
|
||||
rm /tmp/${NODE_TAR}
|
||||
Loading…
x
Reference in New Issue
Block a user