Skip to content

Build dev binary

Build dev binary #29

Workflow file for this run

name: Build dev binary
on:
workflow_dispatch:
jobs:
build-dev-win:
strategy:
fail-fast: false
matrix:
include:
- platform: x64
bcj: -mf=BCJ2
name: x64
- platform: Win32
bcj: -mf=BCJ2
name: x86
- platform: ARM64
bcj: # -mf=ARM64
name: arm64
name: Build ${{ matrix.name }} Windows binary
runs-on: windows-2019
steps:
- uses: ilammy/msvc-dev-cmd@v1
- uses: actions/checkout@v3
- run: msbuild -property:PlatformToolset=ClangCL -property:Configuration=Release -property:Platform=${{ matrix.platform }} par2cmdline.sln
- run: move "${{ matrix.platform }}\Release\par2.exe" par2.exe && 7z a -t7z -mx=9 ${{ matrix.bcj }} par2.7z par2.exe
- uses: actions/upload-artifact@v3
with:
path: ./par2.7z
name: par2cmdline-turbo-dev-win-${{ matrix.name }}.7z
retention-days: 5
# build-dev-linux-static:
# strategy:
# fail-fast: false
# matrix:
# include:
# - target: x86_64-linux-musl
# xz_bcj: --x86
# name: amd64
# configure_host:
# - target: aarch64-linux-musl
# xz_bcj: # --arm64 # requires xz utils >=5.4 to decompress
# name: aarch64
# configure_host: --host=aarch64
# - target: armv7l-linux-musleabihf
# xz_bcj: --arm
# name: armv7l
# configure_host: --host=armv7l
# name: Build ${{ matrix.name }} Linux static binary
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: Lesmiscore/musl-cross-compilers@heracles
# id: musl
# with:
# target: ${{ matrix.target }}
# - run: aclocal && automake --warnings=all --add-missing && autoconf --warnings=all
# - run: ./configure ${{ matrix.configure_host }}
# env:
# CC: ${{ steps.musl.outputs.path }}/${{ matrix.target }}-cc
# CXX: ${{ steps.musl.outputs.path }}/${{ matrix.target }}-c++
# LDFLAGS: -static -s
# - uses: actions/upload-artifact@v3
# with:
# path: ./config.log
# name: configure-linux-${{ matrix.arch }}.log
# retention-days: 5
# if: ${{ failure() }}
# - run: make
# - run: ./par2 -h
# if: ${{ matrix.name == 'amd64' }}
# - run: make check
# if: ${{ matrix.name == 'amd64' }}
# - run: xz -9e ${{ matrix.xz_bcj }} --lzma2 par2 -c > par2.xz
# - uses: actions/upload-artifact@v3
# with:
# path: ./par2.xz
# name: par2cmdline-turbo-dev-linux-${{ matrix.name }}.xz
# retention-days: 5
build-dev-linux-static:
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
xz_bcj: --x86
xcc:
configure_host:
- arch: arm64
xz_bcj: # --arm64 # requires xz utils >=5.4 to decompress
xcc: aarch64-linux-gnu-
configure_host: --host=aarch64-linux-gnu
- arch: armhf
xz_bcj: --arm
xcc: arm-linux-gnueabihf-
configure_host: --host=armv7l-linux-gnueabihf
- arch: riscv64
xz_bcj:
xcc: riscv64-linux-gnu-
configure_host: --host=riscv64-linux-gnu
- arch: powerpc
xz_bcj:
xcc: powerpc-linux-gnu-
configure_host: --host=powerpc-linux-gnu
name: Build ${{ matrix.arch }} Linux static binary
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: junelife/gha-ubuntu-cross@v6
with:
arch: ${{ matrix.arch }}
if: ${{ matrix.arch != 'amd64' }}
- run: aclocal && automake --warnings=all --add-missing && autoconf --warnings=all
- run: ./configure ${{ matrix.configure_host }}
env:
CC: ${{ matrix.xcc }}gcc
CXX: ${{ matrix.xcc }}g++
LDFLAGS: -static -s
- uses: actions/upload-artifact@v3
with:
path: ./config.log
name: configure-linux-${{ matrix.arch }}.log
retention-days: 5
if: ${{ failure() }}
- run: make
- run: ./par2 -h
if: ${{ matrix.arch == 'amd64' }}
- run: make check
if: ${{ matrix.arch == 'amd64' }}
- run: xz -9e ${{ matrix.xz_bcj }} --lzma2 par2 -c > par2.xz
- uses: actions/upload-artifact@v3
with:
path: ./par2.xz
name: par2cmdline-turbo-dev-linux-${{ matrix.arch }}.xz
retention-days: 5
build-dev-mac-x64:
name: Build x64 MacOS binary
runs-on: macos-latest
steps:
- uses: ConorMacBride/install-package@v1
with:
brew: automake llvm
# force past "The `brew link` step did not complete successfully"
continue-on-error: true
- run: |
if [ -f "`brew --prefix llvm`/bin/clang" ]; then
echo "CC=`brew --prefix llvm`/bin/clang" >> $GITHUB_ENV
echo "CXX=`brew --prefix llvm`/bin/clang++" >> $GITHUB_ENV
fi
- uses: actions/checkout@v3
- run: aclocal && automake --warnings=all --add-missing && autoconf --warnings=all
- run: ./configure
- uses: actions/upload-artifact@v3
with:
path: ./config.log
name: configure-macos-x64.log
retention-days: 5
if: ${{ failure() }}
- run: make
- run: strip par2
- run: ./par2 -h
- run: make check
- run: xz -9e --x86 --lzma2 par2
- uses: actions/upload-artifact@v3
with:
path: ./par2.xz
name: par2cmdline-turbo-dev-macos-x64.xz
retention-days: 5
build-dev-mac-arm64:
name: Build arm64 MacOS binary
# avoid OpenSSL 3.0.2 on 22.04: https://github.com/tpoechtrager/osxcross/issues/349
runs-on: ubuntu-20.04
steps:
- uses: mbround18/setup-osxcross@main # OSXCROSS_TARGET unavailable in v1.1
with:
osx-version: "12.3"
- uses: actions/checkout@v3
- run: aclocal && automake --warnings=all --add-missing && autoconf --warnings=all
- run: ./configure --host=aarch64-macos
env:
CC: oa64-clang
CXX: oa64-clang++
AR: arm64-apple-darwin21.4-ar
RANLIB: arm64-apple-darwin21.4-ranlib
STRIP: arm64-apple-darwin21.4-strip
- uses: actions/upload-artifact@v3
with:
path: ./config.log
name: configure-macos-arm64.log
retention-days: 5
if: ${{ failure() }}
- run: make
- run: arm64-apple-darwin21.4-strip par2
- run: |
wget -q -O- https://github.com/indygreg/apple-platform-rs/releases/download/apple-codesign%2F0.22.0/apple-codesign-0.22.0-x86_64-unknown-linux-musl.tar.gz | tar zxf -
apple-codesign*/rcodesign sign par2
- if: ${{ failure() }}
run: |
ls
ls apple-codesign*
find . -name rcodesign
- run: xz -9e --lzma2 par2
- uses: actions/upload-artifact@v3
with:
path: ./par2.xz
name: par2cmdline-turbo-dev-macos-arm64.xz
retention-days: 5