Skip to content

Commit 472c6ba

Browse files
authored
Auto set GOARCH, fix qt build (#49)
* Auto set GOARCH * Fix image build * Adjust qt image build * Make qt build multistage * Free up more disk space * Free up more space before build * Only free up space for qt
1 parent 1a4e029 commit 472c6ba

8 files changed

Lines changed: 319 additions & 251 deletions

File tree

.github/actions/cleanup/action.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Free up space in the runner
2+
runs:
3+
using: "composite"
4+
steps:
5+
- name: Free up space
6+
shell: bash
7+
run: |
8+
df -h
9+
echo
10+
echo Freeing up space
11+
rm -rf .git/
12+
docker system prune --force
13+
docker rmi $(docker image ls -aq) || true
14+
docker system prune --force
15+
export DEBIAN_FRONTEND="noninteractive"
16+
sudo apt-get autoremove -y
17+
sudo apt-get autoclean -y
18+
sudo rm -rf /usr/lib/jvm
19+
sudo rm -rf /usr/share/dotnet
20+
sudo rm -rf /usr/share/swift
21+
sudo rm -rf /usr/local/.ghcup
22+
sudo rm -rf /usr/local/julia*
23+
sudo rm -rf /usr/local/lib/android
24+
sudo rm -rf /usr/local/share/chromium
25+
sudo rm -rf /opt/microsoft /opt/google
26+
sudo rm -rf /opt/az
27+
sudo rm -rf /usr/local/share/powershell
28+
echo
29+
df -h

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,8 @@ jobs:
6161
password: ${{ secrets.GITHUB_TOKEN }}
6262
- name: Set up Docker Buildx
6363
uses: docker/setup-buildx-action@v3
64+
- name: Free up space
65+
if: ${{ matrix.target == 'qt' }}
66+
uses: ./.github/actions/cleanup
6467
- name: Build and push toolchain
6568
run: ./scripts/build -p -g -s ${{ matrix.target }}

.github/workflows/pr.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
echo "UUID=$UUID" >> "$GITHUB_OUTPUT"
3737
docker image save ghcr.io/toltec-dev/toolchain | gzip > ${{ runner.temp }}/$UUID-toolchain.tar.gz
3838
- name: Upload artifact
39-
uses: actions/upload-artifact@v4
39+
uses: actions/upload-artifact@v4
4040
with:
4141
name: ${{ env.UUID }}-toolchain
4242
path: ${{ runner.temp }}/${{ env.UUID }}-toolchain.tar.gz
@@ -70,14 +70,14 @@ jobs:
7070
run: |
7171
pushd ${{ runner.temp }}
7272
tar xf ${{ needs.stage1.outputs.UUID }}-toolchain.tar.gz
73+
rm ${{ needs.stage1.outputs.UUID }}-toolchain.tar.gz
7374
popd
74-
rm ${{ runner.temp }}/${{ needs.stage1.outputs.UUID }}-toolchain.tar.gz
7575
- name: Build and push toolchain
7676
run: ./scripts/build -g -s base -c ghcr.io/toltec-dev/toolchain=oci-layout://${{ runner.temp }}
7777
- name: Export the container
7878
run: docker image save ghcr.io/toltec-dev/base | gzip > ${{ runner.temp }}/${{ needs.stage1.outputs.UUID }}-base.tar.gz
7979
- name: Upload artifact
80-
uses: actions/upload-artifact@v4
80+
uses: actions/upload-artifact@v4
8181
with:
8282
name: ${{ needs.stage1.outputs.UUID }}-base
8383
path: ${{ runner.temp }}/${{ needs.stage1.outputs.UUID }}-base.tar.gz
@@ -111,14 +111,17 @@ jobs:
111111
run: |
112112
pushd ${{ runner.temp }}
113113
tar xf ${{ needs.stage2.outputs.UUID }}-base.tar.gz
114+
rm ${{ needs.stage2.outputs.UUID }}-base.tar.gz
114115
popd
115-
rm ${{ runner.temp }}/${{ needs.stage2.outputs.UUID }}-base.tar.gz
116+
- name: Free up space
117+
if: ${{ matrix.target == 'qt' }}
118+
uses: ./.github/actions/cleanup
116119
- name: Build and push toolchain
117120
run: ./scripts/build -g -s ${{ matrix.target }} -c ghcr.io/toltec-dev/base=oci-layout://${{ runner.temp }}
118121
- name: Export the container
119122
run: docker image save ghcr.io/toltec-dev/${{ matrix.target }} | gzip > ${{ runner.temp }}/${{ needs.stage1.outputs.UUID }}-${{ matrix.target }}.tar.gz
120123
- name: Upload artifact
121-
uses: actions/upload-artifact@v4
124+
uses: actions/upload-artifact@v4
122125
with:
123126
name: ${{ needs.stage1.outputs.UUID }}-${{ matrix.target }}
124127
path: ${{ runner.temp }}/${{ needs.stage1.outputs.UUID }}-${{ matrix.target }}.tar.gz

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: release
22
on:
33
push:
44
tags:
5-
- '*'
5+
- "*"
66
jobs:
77
stage1:
88
name: Stage 1
@@ -65,6 +65,9 @@ jobs:
6565
run: |
6666
VERSION="$(echo "${{ github.ref }}" | cut -d / -f 3)"
6767
echo "version=$VERSION" >> "$GITHUB_ENV"
68+
- name: Free up space
69+
if: ${{ matrix.target == 'qt' }}
70+
uses: ./.github/actions/cleanup
6871
- name: Set up Docker Buildx
6972
uses: docker/setup-buildx-action@v3
7073
- name: Build and push toolchain

0 commit comments

Comments
 (0)