Skip to content

Commit

Permalink
[devkits] nim devkit
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Apr 8, 2024
1 parent 0438be3 commit db20646
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .docker/nim.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
ARG NIM_VERSION=2.0.2

FROM debian:unstable AS build
RUN apt update && apt install -y build-essential wget git
RUN adduser --disabled-password dev
ARG NIM_VERSION
USER dev
ENV PATH="/home/dev/.nim/bin:$PATH"
# choosenim doesn't work on arm64 D:
#ENV CHOOSENIM_CHOOSE_VERSION=${NIM_VERSION}
#RUN curl https://nim-lang.org/choosenim/init.sh -sSf | sh -s -- -y && \
# nimble refresh
RUN wget -nv https://nim-lang.org/download/nim-${NIM_VERSION}.tar.xz -O - \
| tar -xJ -C /tmp
RUN cd /tmp/nim-${NIM_VERSION} \
&& ./build.sh \
&& bin/nim c koch \
&& ./koch boot -d:release \
&& ./koch tools \
&& ./install.sh /tmp/install-nim \
&& mv /tmp/install-nim/nim /home/dev/.nim \
&& cp ./bin/nimble /home/dev/.nim/bin/ \
&& nimble refresh

FROM scratch
COPY --from=build /home/dev/.nim /home/dev/.nim
20 changes: 20 additions & 0 deletions .github/workflows/devkit-nim.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Devkit (nim)

on:
push:
branches:
- master
- main
paths:
- '.docker/nim.dockerfile'
pull_request:
paths:
- '.docker/nim.dockerfile'
workflow_dispatch:

jobs:
build:
name: Build
uses: ./.github/workflows/devkit.yml
with:
lang: nim
23 changes: 23 additions & 0 deletions .github/workflows/devkit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Devkit

on:
workflow_call:
inputs:
lang:
required: true
type: string

jobs:
build:
name: Build Container
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Publish
uses: elgohr/Publish-Docker-Github-Action@main
with:
name: shish2k/rosettaboy-devkit-${{ inputs.lang }}
dockerfile: .docker/${{ inputs.lang }}.dockerfile
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

0 comments on commit db20646

Please sign in to comment.