Skip to content

Build Electron Builder #22

Build Electron Builder

Build Electron Builder #22

Workflow file for this run

name: Build Electron Builder
on:
workflow_dispatch:
inputs:
rustupVersion:
type: string
required: true
default: "1.27.1"
description: Version of rustup for host rustc
hostRustVersion:
type: string
required: true
default: "1.82.0"
description: Host rustc version
targetRustBranch:
type: string
required: true
default: "beta"
description: Target rustc branch
gccVersion:
type: string
required: true
default: "14.2.0"
description: Gcc version to compile
libffiVersion:
type: string
required: true
default: "3.4.6"
description: Libffi version to compile
imageTag:
type: string
required: true
default: "electron-v32"
description: Tag of the builder image
jobs:
libgcc:
runs-on: [self-hosted, ryustation]
container:
image: ghcr.io/darkyzhou/electron-build-runner:latest
steps:
- uses: actions/checkout@v4
- name: Build libgcc
uses: docker/build-push-action@v5
with:
load: true
tags: libgcc:latest
file: Dockerfile.libgcc
build-args: |
GCC_VERSION=${{ inputs.gccVersion }}
- name: Extract libgcc Artifact
uses: shrink/actions-docker-extract@v3
with:
image: libgcc:latest
path: /root/build/libgcc.tar.gz
destination: dist
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: libgcc
path: dist/libgcc.tar.gz
libffi:
runs-on: [self-hosted, ryustation]
container:
image: ghcr.io/darkyzhou/electron-build-runner:latest
steps:
- uses: actions/checkout@v4
- name: Build libffi
uses: docker/build-push-action@v5
with:
load: true
tags: libffi:latest
file: Dockerfile.libffi
build-args: |
GCC_VERSION=${{ inputs.gccVersion }}
- name: Extract libffi Artifact
uses: shrink/actions-docker-extract@v3
with:
image: libffi:latest
path: /root/build/libffi.tar.gz
destination: dist
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: libffi
path: dist/libffi.tar.gz
rustc:
runs-on: [self-hosted, ryustation]
container:
image: ghcr.io/darkyzhou/electron-build-runner:latest
steps:
- uses: actions/checkout@v4
- name: Build rustc
uses: docker/build-push-action@v5
with:
load: true
tags: rustc:latest
file: Dockerfile.rustc
build-args: |
RUSTUP_VERSION=${{ inputs.rustupVersion }}
HOST_RUST_VERSION=${{ inputs.hostRustVersion }}
TARGET_RUST_BRANCH=${{ inputs.targetRustBranch }}
- name: Extract Artifact
uses: shrink/actions-docker-extract@v3
id: extract
with:
image: rustc:latest
path: /root/rust/rustc.tar.gz
destination: dist
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: rustc
path: dist/rustc.tar.gz
builder:
needs:
- libgcc
- libffi
- rustc
runs-on: [self-hosted, ryustation]
container:
image: ghcr.io/darkyzhou/electron-build-runner:latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: .
merge-multiple: true
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Builder Image
uses: docker/build-push-action@v6
with:
push: true
context: .
file: Dockerfile.builder
tags: ghcr.io/darkyzhou/electron-builder:${{ inputs.imageTag }}