-
Notifications
You must be signed in to change notification settings - Fork 48
65 lines (61 loc) · 2.89 KB
/
build-gcc.yml
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
name: Build GCC
on:
workflow_dispatch:
inputs:
gcc_ref:
description: "GCC branch reference to compile (e.g.: releases/gcc-5)"
required: true
version:
description: "Compiled GCC version number (e.g.: 5)"
required: true
configure:
description: "GCC configuration options"
required: false
default: "--enable-languages=c,c++,fortran --prefix=/usr --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu"
patch:
description: "Patch to be applied (if necessary)"
required: false
default: ""
concurrency:
group: build-gcc-${{ inputs.version }}
cancel-in-progress: true
env:
storage-url: ${{secrets.CI_STORAGE_URL}}
storage-user: ${{secrets.CI_STORAGE_USER}}
storage-token: ${{secrets.CI_STORAGE_TOKEN}}
storage-path: release/compiler
host_jobs: $J
jobs:
build:
runs-on: [self-hosted]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Env setup
id: host
shell: bash
run: |
echo "Current host supports ${{env.host_jobs}} parallel jobs"
echo "jobs=${{env.host_jobs}}" >> $GITHUB_OUTPUT
- name: Set patch
if: ${{ inputs.patch != '' }}
shell: bash
run: |
cp '.github/actions/build-gcc/${{inputs.patch}}' '${{github.workspace}}'
- name: Build GCC-${{inputs.version}}
id: build
uses: ./.github/actions/build-gcc
with:
jobs: ${{steps.host.outputs.jobs}}
branch: ${{inputs.gcc_ref}}
dist-name: gcc-${{inputs.version}}-bambu
config-args: -v --with-pkgversion="Ubuntu gcc-${{inputs.version}}-bambu" --with-bugurl="file:///usr/share/doc/gcc-${{inputs.version}}/README.Bugs" --program-suffix=-${{inputs.version}} ${{ inputs.configure }}
- name: Upload GCC-${{inputs.version}} dist directory
shell: bash
run: |
DIST_TAR="${{steps.build.outputs.dist-dir}}.tar.xz"
STORAGE_URL="${{env.storage-url}}/${{env.storage-path}}/${DIST_TAR}"
export XZ_OPT='-T0'
tar -C ${{steps.build.outputs.dist-dir}} . --mode="u+rwX,g+rwX,o+rX" -cJf ${DIST_TAR}
curl -L --fail -u '${{env.storage-user}}':'${{env.storage-token}}' -T "${DIST_TAR}" "$STORAGE_URL"
echo "### New release available at https://release.bambuhls.eu/compiler/${DIST_TAR}" >> $GITHUB_STEP_SUMMARY