From d990c79dcf8459f6012e3d174b814b708376cd41 Mon Sep 17 00:00:00 2001 From: Jan K9f Date: Sat, 26 Apr 2025 21:46:21 +0200 Subject: [PATCH] -m --- .gitea/workflows/build.yml | 16 +++---- images/actions/go/Dockerfile | 8 ++++ images/actions/java/Dockerfile | 4 ++ images/actions/js/Dockerfile | 3 ++ images/actions/just/Dockerfile | 3 ++ images/actions/lua/Dockerfile | 13 ++++++ images/actions/oas/Dockerfile | 4 ++ images/actions/php/Dockerfile | 16 +++++++ images/actions/protobuf/Dockerfile | 3 ++ images/actions/redot/Dockerfile | 74 ++++++++++++++++++++++++++++++ 10 files changed, 136 insertions(+), 8 deletions(-) create mode 100644 images/actions/go/Dockerfile create mode 100644 images/actions/java/Dockerfile create mode 100644 images/actions/js/Dockerfile create mode 100644 images/actions/just/Dockerfile create mode 100644 images/actions/lua/Dockerfile create mode 100644 images/actions/oas/Dockerfile create mode 100644 images/actions/php/Dockerfile create mode 100644 images/actions/protobuf/Dockerfile create mode 100644 images/actions/redot/Dockerfile diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 64cb46b..280cc7b 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -12,14 +12,14 @@ jobs: runs-on: "ubuntu-latest" steps: - name: Login to Registry - uses: "actions/docker-login@v3" + uses: "docker/login-action@v3" with: registry: git.kjan.de username: ${{ secrets.DEPLOY_USER }} password: ${{ secrets.DEPLOY_SECRET }} - name: Build and push base image id: build_base - uses: "actions/docker-build-push@v5" + uses: "docker/build-push-action@v6" with: context: "{{defaultContext}}:images/actions/act" push: true @@ -28,7 +28,7 @@ jobs: git.kjan.de/actions/runner-basic:${{ github.run_number }} extended-latest: - runs-on: "docker" + runs-on: "ubuntu-latest" needs: - base strategy: @@ -36,14 +36,14 @@ jobs: language: ["go", "js", "protobuf", "oas", "just"] steps: - name: Login to Registry - uses: "actions/docker-login@v3" + uses: "docker/login-action@v3" with: registry: git.kjan.de username: ${{ secrets.DEPLOY_USER }} password: ${{ secrets.DEPLOY_SECRET }} - name: Build and push ${{ matrix.language }} image - uses: "actions/docker-build-push@v5" + uses: "docker/build-push-action@v6" with: context: "{{defaultContext}}:images/actions/${{ matrix.language }}" push: true @@ -52,7 +52,7 @@ jobs: git.kjan.de/actions/runner-${{ matrix.language }}:${{ github.run_number }} extended-versioned: - runs-on: "docker" + runs-on: "ubuntu-latest" needs: - base strategy: @@ -74,14 +74,14 @@ jobs: version: 21 steps: - name: Login to Registry - uses: "actions/docker-login@v3" + uses: "docker/login-action@v3" with: registry: git.kjan.de username: ${{ secrets.DEPLOY_USER }} password: ${{ secrets.DEPLOY_SECRET }} - name: Build and push ${{ matrix.language }} {{ matrix.version }} image - uses: "actions/docker-build-push@v5" + uses: "docker/build-push-action@v6" with: context: "{{defaultContext}}:images/actions/${{ matrix.language }}" push: true diff --git a/images/actions/go/Dockerfile b/images/actions/go/Dockerfile new file mode 100644 index 0000000..265f3ae --- /dev/null +++ b/images/actions/go/Dockerfile @@ -0,0 +1,8 @@ +FROM git.kjan.de/actions/runner-basic:latest + +RUN sudo apk add --no-cache "go" +RUN go install honnef.co/go/tools/cmd/staticcheck@latest +RUN go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest +#RUN go install github.com/miekg/gotmplfmt@latest + +ENV PATH="$PATH:/home/runner/go/bin" diff --git a/images/actions/java/Dockerfile b/images/actions/java/Dockerfile new file mode 100644 index 0000000..de2369a --- /dev/null +++ b/images/actions/java/Dockerfile @@ -0,0 +1,4 @@ +FROM git.kjan.de/actions/runner-basic:latest +ARG PACKAGE_VERSION + +RUN sudo apk add --no-cache "openjdk$PACKAGE_VERSION" maven gradle libxml2-utils diff --git a/images/actions/js/Dockerfile b/images/actions/js/Dockerfile new file mode 100644 index 0000000..ba88f45 --- /dev/null +++ b/images/actions/js/Dockerfile @@ -0,0 +1,3 @@ +FROM git.kjan.de/actions/runner-basic:latest + +RUN sudo apk add --no-cache "npm" diff --git a/images/actions/just/Dockerfile b/images/actions/just/Dockerfile new file mode 100644 index 0000000..7211132 --- /dev/null +++ b/images/actions/just/Dockerfile @@ -0,0 +1,3 @@ +FROM git.kjan.de/actions/runner-basic:latest + +RUN sudo apk add --no-cache just diff --git a/images/actions/lua/Dockerfile b/images/actions/lua/Dockerfile new file mode 100644 index 0000000..fee4361 --- /dev/null +++ b/images/actions/lua/Dockerfile @@ -0,0 +1,13 @@ +FROM git.kjan.de/actions/runner-basic:latest +ARG PACKAGE_VERSION + +RUN release_info=$(curl -s https://api.github.com/repos/LuaLS/lua-language-server/releases/latest) \ + && download_url=$(echo "$release_info" | jq -r '.assets[] | select(.name | endswith("linux-x64-musl.tar.gz")) | .browser_download_url') \ + && curl -LO "$download_url" \ + && tar_file=$(basename "$download_url") \ + && mkdir /opt/lua-language-server \ + && tar -xf "$tar_file" -C /opt/lua-language-server \ + && rm -rf "$tar_file" +ENV PATH="/opt/lua-language-server/bin:${PATH}" + +RUN sudo apk add --no-cache "lua$PACKAGE_VERSION" "luarocks$PACKAGE_VERSION" stylua luacheck diff --git a/images/actions/oas/Dockerfile b/images/actions/oas/Dockerfile new file mode 100644 index 0000000..5f76be4 --- /dev/null +++ b/images/actions/oas/Dockerfile @@ -0,0 +1,4 @@ +FROM git.kjan.de/actions/runner-js:latest + +RUN sudo apk add --no-cache py3-openapi-spec-validator +RUN sudo npm install -g swagger-cli @redocly/cli@latest diff --git a/images/actions/php/Dockerfile b/images/actions/php/Dockerfile new file mode 100644 index 0000000..69f792a --- /dev/null +++ b/images/actions/php/Dockerfile @@ -0,0 +1,16 @@ +FROM git.kjan.de/actions/runner-basic:latest +ARG PACKAGE_VERSION + +RUN \ + version=$(echo $PACKAGE_VERSION | tr -d .) \ + && curl -1sLf 'https://dl.cloudsmith.io/public/symfony/stable/setup.alpine.sh' | sudo -E bash \ + && sudo apk add --no-cache \ + composer \ + "php${version}" \ + "php${version}-xml" \ + "php${version}-simplexml" \ + "php${version}-tokenizer" \ + "php${version}-xmlwriter" \ + "php${version}-dom" \ + "php${version}-ctype" \ + symfony-cli diff --git a/images/actions/protobuf/Dockerfile b/images/actions/protobuf/Dockerfile new file mode 100644 index 0000000..f3fbf2f --- /dev/null +++ b/images/actions/protobuf/Dockerfile @@ -0,0 +1,3 @@ +FROM git.kjan.de/actions/runner-basic:latest + +RUN sudo apk add --no-cache protobuf diff --git a/images/actions/redot/Dockerfile b/images/actions/redot/Dockerfile new file mode 100644 index 0000000..35c1035 --- /dev/null +++ b/images/actions/redot/Dockerfile @@ -0,0 +1,74 @@ +FROM alpine:latest AS build-stage + +ARG PACKAGE_VERSION + +RUN apk add --no-cache curl + +RUN wget $( \ + curl -s https://api.github.com/repos/Redot-Engine/redot-engine/releases/tags/redot-$PACKAGE_VERSION-stable \ + | grep "browser_download_url.*Redot_v.*-stable_export_templates\.tpz" \ + | cut -d '"' -f 4 - \ + | head -n 1 \ + ) -O Redot_Export_Templates.tbz + +RUN unzip Redot_Export_Templates.tbz + +RUN rm -f templates/*debug* + +RUN rm Redot_Export_Templates.tbz + +FROM git.euph.dev/actions/runner-basic-glib:latest AS final-stage + +ARG PACKAGE_VERSION + +# fontconfig and eudev-dev are not needed in ci, and will segfault +RUN sudo apk add --no-cache \ + scons \ + pkgconf \ + gcc \ + g++ \ + libx11-dev \ + libxcursor-dev \ + libxinerama-dev \ + libxi-dev \ + libxrandr-dev \ + mesa-dev \ + alsa-lib-dev \ + pulseaudio-dev \ + pipx + +RUN pipx install "gdtoolkit==$PACKAGE_VERSION.*" + +ENV PATH="$PATH:/home/runner/.local/bin" + +RUN wget $( \ + curl -s https://api.github.com/repos/Redot-Engine/redot-engine/releases/tags/redot-$PACKAGE_VERSION-stable \ + | grep "browser_download_url.*Redot_v.*-stable_linux\.x86_64\.zip" \ + | cut -d '"' -f 4 - \ + | head -n 1 \ + ) -O Redot.zip \ + && sudo unzip Redot.zip \ + && sudo mv ./Redot_v*-stable_linux.x86_64 /usr/local/bin/redot \ + && rm Redot.zip + +RUN mkdir -p /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable +COPY --from=build-stage /templates/android_release.apk /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/android_source.zip /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/ios.zip /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/linux_release.arm32 /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/linux_release.arm64 /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/linux_release.x86_32 /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/linux_release.x86_64 /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/macos.zip /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/version.txt /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/web_dlink_nothreads_release.zip /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/web_dlink_release.zip /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/web_nothreads_release.zip /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/web_release.zip /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/windows_release_arm64_console.exe /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/windows_release_arm64.exe /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/windows_release_x86_32_console.exe /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/windows_release_x86_32.exe /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/windows_release_x86_64_console.exe /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/windows_release_x86_64.exe /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +