Skip to content

Commit c24a7c3

Browse files
committed
Update github actions
1 parent dde0e0c commit c24a7c3

File tree

2 files changed

+101
-25
lines changed

2 files changed

+101
-25
lines changed

.github/workflows/build-toolchain.yml

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

.github/workflows/build.yml

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,57 @@ name: build
22

33
on:
44
workflow_dispatch:
5-
# push:
5+
inputs:
6+
uploadRelease:
7+
description: "Create Github Release"
8+
type: boolean
9+
tag:
10+
description: "Github release tag"
611

712
jobs:
8-
linux:
9-
runs-on: ubuntu-latest
13+
generate_toolchain:
1014
strategy:
1115
fail-fast: false
1216
matrix:
13-
arch: [bionic-x64, bionic-arm64, bionic-armhf, centos7-devtoolset8-x64, centos7-devtoolset8-arm64]
1417
include:
15-
- arch: centos7-devtoolset8-arm64
16-
qemu: true
18+
- arch: amd64
19+
config: x86_64-gcc-8.5.0-glibc-2.28.config
20+
pkg: x86_64-linux-gnu
21+
- arch: arm64
22+
config: aarch64-gcc-8.5.0-glibc-2.28.config
23+
pkg: aarch64-linux-gnu
24+
- arch: armhf
25+
config: armhf-gcc-8.5.0-glibc-2.28.config
26+
pkg: arm-rpi-linux-gnueabihf
27+
uses: ./.github/workflows/build-toolchain.yml
28+
with:
29+
config: ${{ matrix.config }}
30+
arch: ${{ matrix.arch }}
31+
pkg: ${{ matrix.pkg }}
1732

33+
release_toolchain:
34+
if: github.event.inputs.uploadRelease == 'true'
35+
runs-on: ubuntu-latest
36+
needs: generate_toolchain
1837
steps:
19-
- uses: actions/checkout@v3
38+
- uses: actions/download-artifact@v3
39+
with:
40+
path: artifacts/
2041

21-
- name: Set up QEMU
22-
uses: docker/setup-qemu-action@v2
23-
if: matrix.qemu == true
42+
- run: |
43+
mkdir upload
2444
25-
- name: Set up Docker Buildx
26-
uses: docker/setup-buildx-action@v2
27-
with:
28-
install: true
45+
cp artifacts/amd64/x86_64-linux-gnu.tar.gz upload/x86_64-linux-gnu.tar.gz
46+
cp artifacts/arm64/aarch64-linux-gnu.tar.gz upload/aarch64-linux-gnu.tar.gz
47+
cp artifacts/armhf/arm-rpi-linux-gnueabihf.tar.gz upload/arm-rpi-linux-gnueabihf.tar.gz
2948
30-
- name: Login to DockerHub
31-
uses: docker/login-action@v2
32-
with:
33-
username: ${{ secrets.DOCKERHUB_USERNAME }}
34-
password: ${{ secrets.DOCKERHUB_TOKEN }}
49+
cd upload
50+
shasum -a 256 *.tar.gz > SHASUMS256.txt
3551
36-
- name: Build and push
37-
uses: docker/build-push-action@v4
52+
- name: Create GitHub Release
53+
uses: softprops/action-gh-release@v1
3854
with:
39-
context: ${{ matrix.arch }}
40-
file: ${{ matrix.arch }}/Dockerfile
41-
tags: gitpod/openvscode-server-linux-build-agent:${{ matrix.arch }}
42-
push: ${{ github.ref == 'refs/heads/main' }}
55+
repository: ${{ github.repository_owner }}/vscode-linux-build-agent
56+
tag_name: ${{ inputs.tag }}
57+
token: ${{ secrets.VSCODE_GITHUB_TOKEN }}
58+
files: upload/*

0 commit comments

Comments
 (0)