Skip to content

Commit 8317dda

Browse files
committed
supresses spinner output in ct-ng to be less verbose in ci/cd
remove -it for ci/cd builds adds set -e to bash scripts and docker start to fail on error adds initial workflow.yaml to automate release process
1 parent 6bf1004 commit 8317dda

File tree

5 files changed

+67
-3
lines changed

5 files changed

+67
-3
lines changed

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release Pipeline
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Triggers on version tags like v1.0.0
7+
8+
jobs:
9+
build-and-release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Build artifacts
15+
run: |
16+
./docker_build_and_run.sh x86_64
17+
./docker_build_and_run.sh aarch64
18+
19+
- name: Prepare release artifacts
20+
run: |
21+
# Create dist directory for final artifacts
22+
mkdir -p dist
23+
cp output/x86_64-unknown-linux-gnu_gcc12.tar.gz* dist/
24+
cp output/aarch64-unknown-linux-gnu_gcc12.tar.gz* dist/
25+
26+
echo "Release artifacts:"
27+
ls -la dist/
28+
29+
- name: Upload Release Artifacts
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: release-artifacts
33+
path: ./dist/*
34+
if-no-files-found: error # Fail if no files found
35+
36+
- name: Create Release
37+
uses: softprops/action-gh-release@v1
38+
if: startsWith(github.ref, 'refs/tags/')
39+
with:
40+
files: ./dist/*
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
set -e
23

34
# *******************************************************************************
45
# Copyright (c) 2025 Contributors to the Eclipse Foundation
@@ -64,3 +65,7 @@ tar -c \
6465
--numeric-owner \
6566
-C "output/${TARGET_TRIPLET}_gcc${GCC}" . \
6667
| gzip -n > "output/${TARGET_TRIPLET}_gcc${GCC}.tar.gz"
68+
69+
cd output
70+
sha256sum ${TARGET_TRIPLET}_gcc${GCC}.tar.gz > ${TARGET_TRIPLET}_gcc${GCC}.tar.gz.sha256
71+
cd ..

configs/aarch64-unknown-linux-gnu_gcc12

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ CT_GLIBC_KERNEL_VERSION_NONE=y
1313
CT_GCC_V_12=y
1414
CT_CC_GCC_LNK_HASH_STYLE_BOTH=y
1515
CT_CC_LANG_CXX=y
16-
CT_COMP_LIBS_EXPAT=y
16+
CT_COMP_LIBS_EXPAT=y
17+
CT_LOG_PROGRESS_BAR=n

configs/x86_64-unknown-linux-gnu_gcc12

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ CT_GCC_V_12=y
1212
CT_CC_GCC_LNK_HASH_STYLE_BOTH=y
1313
CT_CC_LANG_CXX=y
1414
CT_COMP_LIBS_EXPAT=y
15+
CT_LOG_PROGRESS_BAR=n

docker_build_and_run.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
set -e
23

34
# *******************************************************************************
45
# Copyright (c) 2025 Contributors to the Eclipse Foundation
@@ -39,5 +40,19 @@ GCC_VERSION=${2:-12}
3940

4041
echo "Building toolchain for architecture: $ARCH with GCC version: $GCC_VERSION"
4142

42-
# Execute the build of the selected toolchain
43-
docker run --rm -it --user "$(id -u):$(id -g)" -v ${PWD}:/workspace $FULL_IMAGE_NAME /bin/bash -c "cd /workspace && GCC=$GCC_VERSION ARCH=$ARCH ./build.sh"
43+
# Check if we're in a CI environment
44+
if [ -n "$CI" ] || [ ! -t 0 ]; then
45+
# CI environment - no interactive/tty
46+
docker run --rm --user "$(id -u):$(id -g)" -v ${PWD}:/workspace $FULL_IMAGE_NAME /bin/bash -c "
47+
set -e
48+
cd /workspace
49+
GCC=$GCC_VERSION ARCH=$ARCH ./build.sh
50+
"
51+
else
52+
# Local development - interactive mode
53+
docker run --rm -it --user "$(id -u):$(id -g)" -v ${PWD}:/workspace $FULL_IMAGE_NAME /bin/bash -c "
54+
set -e
55+
cd /workspace
56+
GCC=$GCC_VERSION ARCH=$ARCH ./build.sh
57+
"
58+
fi

0 commit comments

Comments
 (0)