neo-devpack-solidity 0.22.0

Production-focused Solidity-to-NeoVM compilation system
Documentation
name: Docker Build & Deploy
on:
  push:
    branches:
    - main
    tags:
    - v*
  pull_request:
    branches:
    - main
env:
  REGISTRY: ghcr.io
  IMAGE_NAME: r3e-network/neo-devpack-solidity
jobs:
  docker-build:
    name: Build Docker Images
    runs-on: ubuntu-latest
    steps:
    - name: Checkout repository
      uses: actions/checkout@v4
    - name: Set up Docker Buildx
      uses: docker/setup-buildx-action@v3
    - name: Log in to Container Registry
      if: github.event_name != 'pull_request'
      uses: docker/login-action@v3
      with:
        registry: ${{ env.REGISTRY }}
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
    - name: Extract metadata
      id: meta
      uses: docker/metadata-action@v5
      with:
        images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
        tags: 'type=ref,event=branch

          type=ref,event=pr

          type=semver,pattern={{version}}

          type=semver,pattern={{major}}.{{minor}}

          type=semver,pattern={{major}}

          type=sha,prefix=commit-

          '
    - name: Build test image (linux/amd64)
      uses: docker/build-push-action@v5
      with:
        context: .
        platforms: linux/amd64
        load: true
        tags: neo-devpack-solidity:test
        cache-from: type=gha
    - name: Test Docker image
      env:
        IMAGE_UNDER_TEST: neo-devpack-solidity:test
      run: '# Test the built image

        docker run --rm "$IMAGE_UNDER_TEST" neo-solc --version


        # Test compilation in Docker

        echo ''contract Test { uint256 public value; }'' > DockerTest.sol

        docker run --rm -v "$(pwd)":/workspace "$IMAGE_UNDER_TEST" neo-solc DockerTest.sol
        -o DockerTest


        # Verify outputs

        test -f DockerTest.nef || exit 1

        test -f DockerTest.manifest.json || exit 1


        echo "✅ Docker image validation passed"

        '
    - name: Build and push Docker image
      if: github.event_name != 'pull_request'
      uses: docker/build-push-action@v5
      with:
        context: .
        platforms: linux/amd64
        push: true
        tags: ${{ steps.meta.outputs.tags }}
        labels: ${{ steps.meta.outputs.labels }}
        cache-from: type=gha
        cache-to: type=gha,mode=max
    timeout-minutes: 45
  dev-environment:
    name: Development Environment Setup
    runs-on: ubuntu-latest
    steps:
    - name: Checkout repository
      uses: actions/checkout@v4
    - name: Create development Docker image
      run: "cat > Dockerfile.dev << 'EOF'\nFROM ubuntu:22.04\n\n# Install development\
        \ dependencies\nRUN apt-get update && apt-get install -y \\\n    curl \\\n\
        \    git \\\n    build-essential \\\n    pkg-config \\\n    libssl-dev \\\n\
        \    jq \\\n    vim \\\n    && rm -rf /var/lib/apt/lists/*\n\n# Install Rust\n\
        RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\n\
        ENV PATH=\"/root/.cargo/bin:$PATH\"\n\n# Install .NET\nRUN curl -sSL https://dot.net/v1/dotnet-install.sh\
        \ | bash /dev/stdin --channel 6.0\nENV PATH=\"/root/.dotnet:$PATH\"\n\n# Install\
        \ Node.js\nRUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \\\
        \n    && apt-get install -y nodejs\n\n# Install Go\nRUN curl -L https://go.dev/dl/go1.21.0.linux-amd64.tar.gz\
        \ | tar -C /usr/local -xz\nENV PATH=\"/usr/local/go/bin:$PATH\"\n\n# Set working\
        \ directory\nWORKDIR /workspace\n\n# Create development script\nRUN echo '#!/bin/bash'\
        \ > /usr/local/bin/dev-setup \\\n    && echo 'echo \"\U0001F680 Neo DevPack for Solidity\
        \ Development Environment\"' >> /usr/local/bin/dev-setup \\\n    && echo 'echo\
        \ \"Repository: https://github.com/r3e-network/neo-devpack-solidity\"' >> /usr/local/bin/dev-setup\
        \ \\\n    && echo 'echo \"Author: Jimmy <jimmy@r3e.network>\"' >> /usr/local/bin/dev-setup\
        \ \\\n    && echo 'echo \"\"' >> /usr/local/bin/dev-setup \\\n    && echo\
        \ 'echo \"Available commands:\"' >> /usr/local/bin/dev-setup \\\n    && echo\
        \ 'echo \"  cargo build --release    # Build Rust compiler\"' >> /usr/local/bin/dev-setup\
        \ \\\n    && echo 'echo \"  dotnet build            # Build C# runtime\"'\
        \ >> /usr/local/bin/dev-setup \\\n    && echo 'echo \"  npm install && npm\
        \ run build  # Build tooling\"' >> /usr/local/bin/dev-setup \\\n    && echo\
        \ 'echo \"  make test-all           # Run all tests\"' >> /usr/local/bin/dev-setup\
        \ \\\n    && chmod +x /usr/local/bin/dev-setup\n\nCMD [\"/usr/local/bin/dev-setup\"\
        ]\nEOF\n"
    - name: Build development image
      run: 'docker build -f Dockerfile.dev -t neo-devpack-solidity-dev:latest .


        # Test development environment

        docker run --rm neo-devpack-solidity-dev:latest

        '
    - name: Tag development image
      if: github.ref == 'refs/heads/main'
      run: 'docker tag neo-devpack-solidity-dev:latest ${{ env.REGISTRY }}/${{ env.IMAGE_NAME
        }}:dev

        '
    - name: Push development image
      if: github.ref == 'refs/heads/main'
      run: 'echo ${{ secrets.GITHUB_TOKEN }} | docker login ${{ env.REGISTRY }} -u
        ${{ github.actor }} --password-stdin

        docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:dev

        '
    timeout-minutes: 15