Skip to content

Commit

Permalink
[devkits] rust devkit
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Apr 8, 2024
1 parent c505c41 commit 5cbb2ba
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .docker/rust.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM debian:unstable AS build
ARG VERSION
RUN apt update && apt install -y adduser wget
RUN adduser --disabled-password dev
USER dev
ENV PATH="/home/dev/.cargo/bin:$PATH"
RUN wget -nv -qO - https://sh.rustup.rs | sh -s -- --default-toolchain ${VERSION} -y \
&& cargo search foo
# Cranelift is only in nightly
RUN rustup toolchain install nightly \
&& rustup component add rustc-codegen-cranelift-preview --toolchain nightly

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

on:
push:
branches:
- master
- main
paths:
- '.docker/rust.dockerfile'
- '.github/workflows/devkit-rust.yml'
pull_request:
paths:
- '.docker/rust.dockerfile'
- '.github/workflows/devkit-rust.yml'
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-22.04
strategy:
matrix:
lang: ["rust"]
version: ["1.77.1"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Publish
uses: elgohr/Publish-Docker-Github-Action@main
with:
name: shish2k/rosettaboy-devkit-${{ matrix.lang }}
dockerfile: .docker/${{ matrix.lang }}.dockerfile
buildoptions: "--build-arg VERSION=${{ matrix.version }}"
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: ${{ matrix.version }}
platforms: linux/amd64,linux/arm64

0 comments on commit 5cbb2ba

Please sign in to comment.