Skip to content

Commit 1daba3f

Browse files
committed
refactor: build workflows to add userdocs/qbt-musl-cross-make
1 parent 22b21d7 commit 1daba3f

File tree

8 files changed

+46
-247
lines changed

8 files changed

+46
-247
lines changed
File renamed without changes.

.github/workflows/build.yml

Lines changed: 44 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,60 @@ name: Build cross compilers
1010
required: true
1111
default: false
1212
type: boolean
13-
updateExisting:
13+
update_existing:
1414
description: Update existing release
1515
required: true
1616
default: true
1717
type: boolean
18+
repo:
19+
description: Build repository
20+
required: true
21+
default: both
22+
type: choice
23+
options:
24+
- both
25+
- richfelker/musl-cross-make
26+
- userdocs/qbt-musl-cross-make
27+
target:
28+
description: Target name (leave empty to build all)
1829
jobs:
1930
prepare:
2031
runs-on: ubuntu-latest
2132
permissions:
2233
contents: write
2334
outputs:
24-
upload_url: '${{ steps.create_release.outputs.upload_url }}'
35+
upload_url: ${{ steps.create_release.outputs.upload_url }}
36+
matrix_repos: ${{ steps.triples.outputs.matrix_repos }}
37+
matrix_targets: ${{ steps.triples.outputs.matrix_targets }}
2538
steps:
2639
- name: Create release
2740
uses: ncipollo/release-action@v1
2841
id: create_release
2942
if: '${{ github.event.inputs.do_release }}'
3043
with:
31-
allowUpdates: '${{ github.event.inputs.updateExisting }}'
44+
allowUpdates: '${{ github.event.inputs.update_existing }}'
3245
tag: '${{ github.event.inputs.release }}'
3346
name: '${{ github.event.inputs.release }}'
3447
draft: false
3548
prerelease: false
3649
env:
3750
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
51+
52+
- name: Bootstrap the matrix
53+
id: triples
54+
run: |
55+
if [ "${{ github.event.inputs.repo }}" = "both" ]; then
56+
echo "matrix_repos=['richfelker/musl-cross-make', 'userdocs/qbt-musl-cross-make']" >> $GITHUB_OUTPUT
57+
else
58+
echo "matrix_repos=['${{ github.event.inputs.repo }}']" >> $GITHUB_OUTPUT
59+
fi
60+
61+
if [ -z "${{ github.event.inputs.target }}" ]; then
62+
echo "matrix_targets=$(jq -R -s 'split("\n") | map(select(length > 0))' .github/targets.txt)" >> $GITHUB_OUTPUT
63+
else
64+
echo "matrix_targets=['${{ github.event.inputs.target }}']" >> $GITHUB_OUTPUT
65+
fi
66+
3867
compile:
3968
needs: prepare
4069
runs-on: ubuntu-latest
@@ -43,68 +72,27 @@ jobs:
4372
continue-on-error: true
4473
strategy:
4574
matrix:
46-
target:
47-
- aarch64-linux-musl
48-
- aarch64_be-linux-musl
49-
- arm-linux-musleabi
50-
- arm-linux-musleabihf
51-
- armeb-linux-musleabi
52-
- armeb-linux-musleabihf
53-
- armel-linux-musleabi
54-
- armel-linux-musleabihf
55-
- armv5l-linux-musleabihf
56-
- armv7l-linux-musleabihf
57-
- armv7m-linux-musleabi
58-
- armv7r-linux-musleabihf
59-
- i486-linux-musl
60-
- i686-linux-musl
61-
- loongarch64-linux-musl
62-
- m68k-linux-musl
63-
- microblaze-linux-musl
64-
- microblazeel-linux-musl
65-
- mips-linux-musl
66-
- mips-linux-musln32sf
67-
- mips-linux-muslsf
68-
- mips64-linux-musl
69-
- mips64-linux-musln32
70-
- mips64-linux-musln32sf
71-
- mips64el-linux-musl
72-
- mips64el-linux-musln32
73-
- mips64el-linux-musln32sf
74-
- mipsel-linux-musl
75-
- mipsel-linux-musln32
76-
- mipsel-linux-musln32sf
77-
- mipsel-linux-muslsf
78-
- or1k-linux-musl
79-
- powerpc-linux-musl
80-
- powerpc-linux-muslsf
81-
- powerpc64-linux-musl
82-
- powerpc64le-linux-musl
83-
- powerpcle-linux-musl
84-
- powerpcle-linux-muslsf
85-
- riscv64-linux-musl
86-
- s390x-linux-musl
87-
- sh2-linux-musl
88-
- sh2-linux-muslfdpic
89-
- sh2eb-linux-musl
90-
- sh2eb-linux-muslfdpic
91-
- sh4-linux-musl
92-
- sh4eb-linux-musl
93-
- x86_64-linux-musl
94-
- x86_64-linux-muslx32
95-
repo:
96-
- richfelker/musl-cross-make
97-
- nginxui/pmmp-musl-cross-make
75+
target: ${{ fromJson(needs.prepare.outputs.matrix_targets) }}
76+
repo: ${{ fromJson(needs.prepare.outputs.matrix_repos) }}
77+
exclude:
78+
# Exclude unsupported targets
79+
- target: loongarch64-linux-musl
80+
repo: richfelker/musl-cross-make
9881
env:
9982
TARGET: ${{ matrix.target }}
100-
REPO: ${{ matrix.repo == 'nginxui/pmmp-musl-cross-make' && 'pmmp/musl-cross-make' || matrix.repo }}
83+
REPO: ${{ matrix.repo }}
10184
steps:
10285
- name: Checkout
10386
uses: actions/checkout@v3
10487

10588
- name: 'Clone ${{ matrix.repo }}'
10689
run: 'git clone https://github.com/${{ matrix.repo }} mcm'
10790

91+
- name: Disable binutils gold for loongarch64
92+
if: matrix.target == 'loongarch64-linux-musl'
93+
run: sed "s| --enable-gold=yes||" -i config.mak
94+
working-directory: mcm
95+
10896
- name: 'Build ${{ matrix.target }}'
10997
run: |-
11098
make -j4

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
build: [false, true]
14-
variant: [pmmp/musl-cross-make, richfelker/musl-cross-make]
14+
variant: [richfelker/musl-cross-make, userdocs/qbt-musl-cross-make]
1515
steps:
1616
- name: Checkout code
1717
uses: actions/checkout@v4

builder/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

builder/build.js

Lines changed: 0 additions & 137 deletions
This file was deleted.

builder/package-lock.json

Lines changed: 0 additions & 33 deletions
This file was deleted.

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const build = core.getInput("build").toUpperCase() === "TRUE";
1010
const buildDir = path.join("/opt/", target, variant);
1111

1212
const tags = {
13-
"pmmp/musl-cross-make": "heracles",
1413
"richfelker/musl-cross-make": "heracles",
14+
"userdocs/qbt-musl-cross-make": "heracles",
1515
};
1616

1717
(async () => {

precommit.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)