Skip to content

Commit 0c6e93c

Browse files
committed
test
1 parent 9199d1b commit 0c6e93c

File tree

5 files changed

+270
-8
lines changed

5 files changed

+270
-8
lines changed

.github/workflows/build-toolchain.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Build Toolchain
2+
on:
3+
workflow_call:
4+
inputs:
5+
config:
6+
type: string
7+
required: true
8+
arch:
9+
type: string
10+
required: true
11+
tuple:
12+
type: string
13+
required: true
14+
pkg:
15+
type: string
16+
required: true
17+
18+
jobs:
19+
build-toolchain:
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 180
22+
steps:
23+
- uses: actions/checkout@v3
24+
- name: Prepare dependencies
25+
run: |
26+
set -e
27+
sudo apt-get update
28+
sudo apt-get install -y gcc g++ gperf bison flex texinfo help2man make libncurses5-dev \
29+
python3-dev autoconf automake libtool libtool-bin gawk wget bzip2 xz-utils unzip \
30+
patch rsync meson ninja-build
31+
- name: Setup crosstool-ng
32+
run: |
33+
set -e
34+
wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.26.0.tar.bz2
35+
tar -xjf crosstool-ng-1.26.0.tar.bz2
36+
cd crosstool-ng-1.26.0
37+
./configure --prefix=`pwd`/out
38+
make
39+
make install
40+
- name: Build toolchain
41+
run: |
42+
set -e
43+
export PATH=$PATH:`pwd`/crosstool-ng-1.26.0/out/bin
44+
mkdir toolchain-dir
45+
cd toolchain-dir
46+
cat ../${{ inputs.config }} > .config
47+
ct-ng build
48+
- name: Install additional libraries
49+
run: |
50+
set -e
51+
chmod 0755 -R `pwd`/toolchain-dir/${{ inputs.tuple }}
52+
./sysroot-scripts/sysroot-creator.sh build ${{ inputs.arch }} \
53+
`pwd`/toolchain-dir/${{ inputs.tuple }}/${{ inputs.tuple }}/sysroot
54+
- name: Create pipeline asset
55+
run: |
56+
set -e
57+
cd toolchain-dir
58+
tar -czf ${{ inputs.pkg }}.tar.gz ${{ inputs.tuple }}
59+
- name: Publish artifact
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: ${{ inputs.pkg }}
63+
path: toolchain-dir/${{ inputs.pkg }}.tar.gz

.github/workflows/build.yml

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: Build
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
uploadRelease:
7+
description: "Create Github Release"
8+
type: boolean
9+
tag:
10+
description: "Github release tag"
11+
dockerRelease:
12+
description: "Create Dockerhub Releasee"
13+
type: boolean
14+
15+
jobs:
16+
generate_toolchain:
17+
strategy:
18+
fail-fast: true
19+
matrix:
20+
include:
21+
- arch: amd64
22+
config: x86_64-gcc-10.5.0-glibc-2.28.config
23+
tuple: x86_64-linux-gnu
24+
pkg: x86_64-linux-gnu-glibc-2.28-gcc-10.5.0
25+
- arch: amd64
26+
config: x86_64-gcc-8.5.0-glibc-2.28.config
27+
tuple: x86_64-linux-gnu
28+
pkg: x86_64-linux-gnu-glibc-2.28-gcc-8.5.0
29+
- arch: arm64
30+
config: aarch64-gcc-10.5.0-glibc-2.28.config
31+
tuple: aarch64-linux-gnu
32+
pkg: aarch64-linux-gnu-glibc-2.28-gcc-10.5.0
33+
- arch: arm64
34+
config: aarch64-gcc-8.5.0-glibc-2.28.config
35+
tuple: aarch64-linux-gnu
36+
pkg: aarch64-linux-gnu-glibc-2.28-gcc-8.5.0
37+
- arch: armhf
38+
config: armhf-gcc-10.5.0-glibc-2.28.config
39+
tuple: arm-rpi-linux-gnueabihf
40+
pkg: arm-rpi-linux-gnueabihf-glibc-2.28-gcc-10.5.0
41+
- arch: armhf
42+
config: armhf-gcc-8.5.0-glibc-2.28.config
43+
tuple: arm-rpi-linux-gnueabihf
44+
pkg: arm-rpi-linux-gnueabihf-glibc-2.28-gcc-8.5.0
45+
uses: ./.github/workflows/build-toolchain.yml
46+
with:
47+
config: ${{ matrix.config }}
48+
arch: ${{ matrix.arch }}
49+
tuple: ${{ matrix.tuple }}
50+
pkg: ${{ matrix.pkg }}
51+
52+
generate_musl_toolchain:
53+
runs-on: ubuntu-latest
54+
timeout-minutes: 180
55+
steps:
56+
- uses: actions/checkout@v3
57+
- name: Build musl toolchain
58+
run: |
59+
set -e
60+
./build-musl-toolchain.sh aarch64-linux-musl aarch64-linux-musl-gcc-10.3.0
61+
- name: Publish artifact
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: aarch64-linux-musl-gcc-10.3.0
65+
path: aarch64-linux-musl-gcc-10.3.0.tar.gz
66+
67+
release_toolchain:
68+
if: github.event.inputs.uploadRelease == 'true'
69+
runs-on: ubuntu-latest
70+
needs: [generate_toolchain, generate_musl_toolchain]
71+
steps:
72+
- uses: actions/download-artifact@v3
73+
with:
74+
path: artifacts/
75+
76+
- run: |
77+
mkdir upload
78+
79+
cp artifacts/x86_64-linux-gnu-glibc-2.28-gcc-10.5.0/x86_64-linux-gnu-glibc-2.28-gcc-10.5.0.tar.gz upload/x86_64-linux-gnu-glibc-2.28-gcc-10.5.0.tar.gz
80+
cp artifacts/aarch64-linux-gnu-glibc-2.28-gcc-10.5.0/aarch64-linux-gnu-glibc-2.28-gcc-10.5.0.tar.gz upload/aarch64-linux-gnu-glibc-2.28-gcc-10.5.0.tar.gz
81+
cp artifacts/arm-rpi-linux-gnueabihf-glibc-2.28-gcc-10.5.0/arm-rpi-linux-gnueabihf-glibc-2.28-gcc-10.5.0.tar.gz upload/arm-rpi-linux-gnueabihf-glibc-2.28-gcc-10.5.0.tar.gz
82+
83+
cp artifacts/x86_64-linux-gnu-glibc-2.28-gcc-8.5.0/x86_64-linux-gnu-glibc-2.28-gcc-8.5.0.tar.gz upload/x86_64-linux-gnu-glibc-2.28-gcc-8.5.0.tar.gz
84+
cp artifacts/aarch64-linux-gnu-glibc-2.28-gcc-8.5.0/aarch64-linux-gnu-glibc-2.28-gcc-8.5.0.tar.gz upload/aarch64-linux-gnu-glibc-2.28-gcc-8.5.0.tar.gz
85+
cp artifacts/arm-rpi-linux-gnueabihf-glibc-2.28-gcc-8.5.0/arm-rpi-linux-gnueabihf-glibc-2.28-gcc-8.5.0.tar.gz upload/arm-rpi-linux-gnueabihf-glibc-2.28-gcc-8.5.0.tar.gz
86+
87+
cp artifacts/aarch64-linux-musl-gcc-10.3.0/aarch64-linux-musl-gcc-10.3.0.tar.gz upload/aarch64-linux-musl-gcc-10.3.0.tar.gz
88+
89+
cd upload
90+
shasum -a 256 *.tar.gz > SHASUMS256.txt
91+
92+
- name: Create GitHub Release
93+
uses: softprops/action-gh-release@v1
94+
with:
95+
repository: ${{ github.repository_owner }}/vscode-linux-build-agent
96+
tag_name: ${{ inputs.tag || format('v{0}-{1}', github.run_number, github.run_id) }}
97+
files: upload/*
98+
99+
linux:
100+
runs-on: ubuntu-latest
101+
strategy:
102+
fail-fast: false
103+
matrix:
104+
arch: [alpine-arm64, alpine-x64, snapcraft-x64]
105+
include:
106+
- arch: alpine-arm64
107+
qemu: true
108+
109+
steps:
110+
- uses: actions/checkout@v3
111+
112+
- name: Set up QEMU
113+
uses: docker/setup-qemu-action@v2
114+
if: matrix.qemu == true
115+
116+
- name: Set up Docker Buildx
117+
uses: docker/setup-buildx-action@v2
118+
with:
119+
install: true
120+
121+
- name: Login to DockerHub
122+
uses: docker/login-action@v2
123+
with:
124+
username: ${{ secrets.DOCKERHUB_USERNAME }}
125+
password: ${{ secrets.DOCKERHUB_TOKEN }}
126+
127+
- name: Build and push
128+
uses: docker/build-push-action@v4
129+
with:
130+
context: ${{ matrix.arch }}
131+
file: ${{ matrix.arch }}/Dockerfile
132+
tags: vscode/vscode-linux-build-agent:${{ matrix.arch }}
133+
push: ${{ inputs.dockerRelease == true }}

alpine-arm64/Dockerfile

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,39 @@
1-
ARG REPO=mcr.microsoft.com/devcontainers/base
2-
ARG TAG=alpine-3.18
1+
ARG REPO=alpine
2+
ARG TAG=3.18
33
FROM --platform=linux/arm64/v8 ${REPO}:${TAG}
44

5-
RUN apk add nodejs npm g++ python3 make git bash curl perl pkgconfig libsecret-dev krb5-dev
5+
# Install build dependencies for VS Code
6+
RUN apk add --no-cache \
7+
nodejs \
8+
npm \
9+
g++ \
10+
python3 \
11+
make \
12+
git \
13+
bash \
14+
curl \
15+
perl \
16+
pkgconfig \
17+
libsecret-dev \
18+
krb5-dev \
19+
xvfb \
20+
xvfb-run \
21+
libx11-dev \
22+
libxkbfile-dev \
23+
libgtk-3-dev \
24+
libnss3-dev \
25+
libasound2-dev \
26+
ca-certificates \
27+
tzdata
628

29+
# Set up environment for GitHub Actions (root user required)
30+
ENV DISPLAY=:99
31+
ENV TEMP=/tmp
32+
RUN chmod a+rwx /tmp
33+
34+
# Create working directory
735
RUN mkdir -p /root/vscode
836
WORKDIR /root/vscode
37+
38+
# GitHub Actions compatibility - ensure running as root
39+
# No USER directive needed as container runs as root by default

alpine-x64/Dockerfile

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,39 @@
1-
ARG REPO=mcr.microsoft.com/devcontainers/base
2-
ARG TAG=alpine-3.18
1+
ARG REPO=alpine
2+
ARG TAG=3.18
33
FROM ${REPO}:${TAG}
44

5-
RUN apk add nodejs npm g++ python3 make git bash curl perl pkgconfig libsecret-dev krb5-dev
5+
# Install build dependencies for VS Code
6+
RUN apk add --no-cache \
7+
nodejs \
8+
npm \
9+
g++ \
10+
python3 \
11+
make \
12+
git \
13+
bash \
14+
curl \
15+
perl \
16+
pkgconfig \
17+
libsecret-dev \
18+
krb5-dev \
19+
xvfb \
20+
xvfb-run \
21+
libx11-dev \
22+
libxkbfile-dev \
23+
libgtk-3-dev \
24+
libnss3-dev \
25+
libasound2-dev \
26+
ca-certificates \
27+
tzdata
628

29+
# Set up environment for GitHub Actions (root user required)
30+
ENV DISPLAY=:99
31+
ENV TEMP=/tmp
32+
RUN chmod a+rwx /tmp
33+
34+
# Create working directory
735
RUN mkdir -p /root/vscode
836
WORKDIR /root/vscode
37+
38+
# GitHub Actions compatibility - ensure running as root
39+
# No USER directive needed as container runs as root by default

snapcraft-x64/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG RISK=stable
2-
ARG REPO=mcr.microsoft.com/mirror/docker/library/ubuntu
2+
ARG REPO=ubuntu
33
ARG TAG=20.04
44

55
FROM ${REPO}:${TAG} as builder
@@ -76,4 +76,8 @@ ENV LC_ALL="en_US.UTF-8"
7676
ENV SNAP="/snap/snapcraft/current"
7777
ENV SNAP_NAME="snapcraft"
7878
ENV SNAP_ARCH="amd64"
79-
ENV PATH="/snap/bin:/snap/snapcraft/current/usr/bin:$PATH"
79+
ENV PATH="/snap/bin:/snap/snapcraft/current/usr/bin:$PATH"
80+
81+
# GitHub Actions compatibility - ensure running as root
82+
# Container runs as root by default, which is required for GitHub Actions
83+
# https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user

0 commit comments

Comments
 (0)