66 - ' **'
77
88jobs :
9- build-linux-x86_64 :
9+ build :
1010 runs-on : ubuntu-latest
1111
12+ strategy :
13+ matrix :
14+ target : [linux-x86_64, linux-aarch64, windows-x86_64]
15+
1216 steps :
1317 - name : Checkout repository
1418 uses : actions/checkout@v4
@@ -17,25 +21,37 @@ jobs:
1721 run : |
1822 sudo apt-get update
1923 sudo apt-get install -y g++ make libunistring-dev
24+ gcc-aarch64-linux-gnu \
25+ g++-aarch64-linux-gnu \
26+ gcc-mingw-w64-x86-64 \
27+ g++-mingw-w64-x86-64
28+
29+ - name : Resolve compiler for ${{ matrix.target }}
30+ id : compiler
31+ run : |
32+ COMPILER=$(./scripts/resolve_compiler.sh ${{ matrix.target }})
33+ echo "compiler=$COMPILER" >> "$GITHUB_OUTPUT"
2034
2135 - name : Build binary
22- run : make BIN=build/strui-linux-x86_64
36+ run : |
37+ mkdir -p build
38+ make BIN=build/strui-${{ matrix.target }} CXX=${{ steps.compiler.outputs.compiler }}
2339
2440 - name : Package binary
2541 run : |
26- TARGET=linux-x86_64
42+ TARGET=${{ matrix.target }}
2743 mkdir -p dist/$TARGET
28- strip build/strui-$TARGET
44+ strip build/strui-$TARGET || true
2945 tar -czf dist/$TARGET/strui-$TARGET.tar.gz -C build strui-$TARGET
3046 sha256sum dist/$TARGET/strui-$TARGET.tar.gz > dist/$TARGET/strui-$TARGET.sha256
3147
3248 - name : Upload release assets
3349 uses : softprops/action-gh-release@v2
3450 with :
3551 files : |
36- dist/linux-x86_64 /strui-linux-x86_64 .tar.gz
37- dist/linux-x86_64 /strui-linux-x86_64 .sha256
52+ dist/${{ matrix.target }} /strui-${{ matrix.target }} .tar.gz
53+ dist/${{ matrix.target }} /strui-${{ matrix.target }} .sha256
3854 generate_release_notes : true
3955 env :
4056 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
41-
57+
0 commit comments