Skip to content

test

test #34

Workflow file for this run

name: build
on:
workflow_dispatch:
push:
jobs:
build-linux:
if: false
name: ${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch: arm64
tool: aarch64-unknown-linux-musl
- arch: arm
tool: arm-unknown-linux-musleabi
- arch: armhf
tool: arm-unknown-linux-musleabihf
- arch: armv7
tool: armv7-unknown-linux-musleabi
- arch: armv7hf
tool: armv7-unknown-linux-musleabihf
- arch: loong64
tool: loongarch64-unknown-linux-musl
- arch: m68k
tool: m68k-unknown-linux-musl
- arch: mips64el
tool: mips64el-unknown-linux-musl
- arch: mips64
tool: mips64-unknown-linux-musl
- arch: mipsel
tool: mipsel-unknown-linux-musl
- arch: mipselsf
tool: mipsel-unknown-linux-muslsf
- arch: mips
tool: mips-unknown-linux-musl
- arch: mipssf
tool: mips-unknown-linux-muslsf
- arch: ppc64
tool: powerpc64-unknown-linux-musl
- arch: ppc
tool: powerpc-unknown-linux-musl
- arch: riscv
tool: riscv32-unknown-linux-musl
- arch: riscv64
tool: riscv64-unknown-linux-musl
- arch: s390x
tool: s390x-ibm-linux-musl
- arch: sh
tool: sh-multilib-linux-musl
- arch: x86
tool: x86_64-multilib-linux-musl
env:
CFLAGS: '-m32'
LDFLAGS: '-m32'
- arch: x86-64
tool: x86_64-multilib-linux-musl
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
- name: Set up build tools
env:
REPO: 'spvkgn/musl-cross'
TOOL: ${{ matrix.tool }}
run: |
mkdir -p $HOME/tools
wget -qO- https://github.com/$REPO/releases/download/latest/$TOOL.tar.xz | tar -C $HOME/tools -xJ || exit 1
[ -d "$HOME/tools/$TOOL/bin" ] && echo "$HOME/tools/$TOOL/bin" >> $GITHUB_PATH
- name: Build
id: build
env:
ARCH: ${{ matrix.arch }}
TOOL: ${{ matrix.tool }}
CFLAGS: ${{ matrix.env.CFLAGS }}
LDFLAGS: ${{ matrix.env.LDFLAGS }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
sed -i 's/ -O./ -Os/' Makefile
CFLAGS="-static-libgcc -static $CFLAGS" \
LDFLAGS="-static-libgcc -static -s $LDFLAGS" \
make -j$(nproc) CC=$TOOL-gcc LD=$TOOL-ld AR=$TOOL-ar NM=$TOOL-nm STRIP=$TOOL-strip || exit 1
tar -cJvf byedpi-$ARCH.tar.xz ciadpi
- name: Upload artifacts
if: steps.build.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: byedpi-${{ matrix.arch }}
path: ./**/byedpi-*.tar.xz
build-windows:
if: false
name: ${{ matrix.arch }}-w64
runs-on: ubuntu-24.04
strategy:
matrix:
arch: [x86_64, i686]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
- name: Set up build tools
run: |
sudo apt update -qq && sudo apt install -y mingw-w64
- name: Build
id: build
env:
ARCH: ${{ matrix.arch }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
make windows CC=$ARCH-w64-mingw32-gcc -j$(nproc) || exit 1
$ARCH-w64-mingw32-strip -s ciadpi.exe
zip byedpi-$ARCH-w64.zip ciadpi.exe
- name: Upload artifacts
if: steps.build.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: byedpi-${{ matrix.arch }}-w64
path: ./**/byedpi-*.zip
build-cygwin:
name: Cygwin ${{ matrix.arch }}
runs-on: windows-latest
strategy:
# fail-fast: false
matrix:
arch: [ x86 ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: fix-cygwin
path: byedpi
- name: Set up Cygwin
uses: cygwin/cygwin-install-action@v4
with:
platform: ${{ matrix.arch }}
site: 'http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/2016/08/30/104223'
check-sig: 'false'
packages: >-
gcc-core
make
zip
unzip
wget
- name: Build
shell: C:\cygwin\bin\bash.exe -eo pipefail '{0}'
run: >-
export MAKEFLAGS=-j$(nproc) &&
make -C byedpi &&
ldd byedpi/ciadpi.exe
- name: Create zip
shell: C:\cygwin\bin\bash.exe -e '{0}'
run: >-
mkdir -p output &&
cp -a -t output byedpi/ciadpi.exe /usr/bin/cygwin1.dll &&
zip byedpi-cygwin-${{ matrix.arch }}.zip -j output/*
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: byedpi-cygwin-${{ matrix.arch }}
path: byedpi-cygwin-*.zip
if-no-files-found: error
release:
needs: [build-linux, build-windows]
permissions:
contents: write
env:
tag_name: latest
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: GH
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release delete ${{ env.tag_name }} --cleanup-tag -y -R ${{ github.repository }} || true
echo "DATE=$(gh api repos/${{ github.repository }}/commits/main --jq '.commit.committer.date' | date -f - +%Y%m%d)" >> $GITHUB_ENV
echo "SHA_SHORT=$(gh api repos/${{ github.repository }}/commits/main --jq '.sha[:7]')" >> $GITHUB_ENV
- name: Upload release assets
uses: softprops/action-gh-release@v2
with:
fail_on_unmatched_files: true
prerelease: false
draft: false
tag_name: ${{ env.tag_name }}
name: ${{ env.DATE }}
body: |
* Commit: hufrea/byedpi@${{ env.SHA_SHORT }}
target_commitish : main
files: |
./**/byedpi-*.tar.xz
./**/byedpi-*.zip