forked from firmadyne/console
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standardize path suffixes during build process
- Loading branch information
Andrew Fasano
committed
Mar 27, 2024
1 parent
e20102d
commit ca9cda1
Showing
2 changed files
with
49 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,6 @@ jobs: | |
- name: Build | ||
run: | | ||
docker run --rm -v $PWD:/app -w /app ghcr.io/panda-re/embedded-toolchains:latest /app/build.sh | ||
tar -czvf console-latest.tar.gz build | ||
- name: Save package | ||
uses: actions/upload-artifact@v3 | ||
|
@@ -50,13 +49,13 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./console-latest.tar.gz | ||
asset_name: console-latest.tar.gz | ||
asset_path: ./console.tar.gz | ||
asset_name: console.tar.gz | ||
asset_content_type: application/gzip | ||
|
||
- name: Publish release | ||
uses: StuYarrow/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
id: ${{ steps.create_release.outputs.id }} | ||
id: ${{ steps.create_release.outputs.id }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,51 @@ | ||
#!/bin/bash | ||
TARGETLIST=(x86_64-linux-gnu i686-linux-musl mipseb-linux-musl mipsel-linux-musl arm-linux-musleabi aarch64-linux-musl mips64eb-linux-musl mips64el-linux-musl) | ||
# rm -rf build | ||
mkdir -p build | ||
BUILDDIR=`realpath build` | ||
echo "Built by $USER on $HOSTNAME at `date`" > build/buildinfo.txt | ||
|
||
BUILDDIR=build | ||
mkdir -p $BUILDDIR | ||
echo "Built by $(whoami) on $HOSTNAME at `date`" > $BUILDDIR/buildinfo.txt | ||
|
||
for TARGET in "${TARGETLIST[@]}"; do | ||
echo "Building for $TARGET" | ||
CC=$TARGET-gcc ARCH=$TARGET BUILD=$BUILDDIR make -j`nproc` all | ||
done | ||
done | ||
|
||
OUT=console | ||
mkdir -p $OUT | ||
|
||
for x in $BUILDDIR/console-*; do | ||
ARCH=$(basename $x | cut -d- -f2-) | ||
case $ARCH in | ||
x86_64-linux-gnu) | ||
SUFFIX="x86_64" | ||
;; | ||
i686-linux-musl) | ||
SUFFIX="x86" | ||
;; | ||
arm-linux-musleabi) | ||
SUFFIX="armel" | ||
;; | ||
aarch64-linux-musl) | ||
SUFFIX="aarch64" | ||
;; | ||
mipsel-linux-musl) | ||
SUFFIX="mipsel" | ||
;; | ||
mipseb-linux-musl) | ||
SUFFIX="mipseb" | ||
;; | ||
mips64eb-linux-musl) | ||
SUFFIX="mips64eb" | ||
;; | ||
mips64el-linux-musl) | ||
SUFFIX="mips64el" | ||
;; | ||
*) | ||
echo "Unsupported architecture: $ARCH" | ||
exit 1 | ||
;; | ||
esac | ||
cp $x ${OUT}/console.${SUFFIX} | ||
done | ||
|
||
tar cvzf console.tar.gz ${OUT} |