-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (113 loc) · 3.15 KB
/
builder.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
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
imageTag:
type: string
required: true
default: "electron-v32"
description: Tag of the builder image
jobs:
libgcc:
runs-on: self-hosted
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
rustc:
runs-on: self-hosted
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
- rustc
runs-on: self-hosted
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 }}