Skip to content

v1.2.0-utf8-20250212 #22

v1.2.0-utf8-20250212

v1.2.0-utf8-20250212 #22

Workflow file for this run

name: Build release binary
on:
release:
types: [published]
#push:
# tags:
# - v*.*.*
jobs:
build-win:
strategy:
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
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- run: msbuild -property:PlatformToolset=ClangCL -property:CharacterSet=Unicode -property:Configuration=Release -property:Platform=${{ matrix.platform }} par2cmdline.sln
- run: move "${{ matrix.platform }}\Release\par2.exe" par2.exe
- run: 7z a -t7z -mx=9 ${{ matrix.bcj }} par2.7z par2.exe
- run: 7z a -tzip -mx=9 par2.zip par2.exe
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./par2.7z
asset_name: par2cmdline-turbo-${{ steps.get_release.outputs.tag_name }}-win-${{ matrix.name }}.7z
asset_content_type: application/octet-stream
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./par2.zip
asset_name: par2cmdline-turbo-${{ steps.get_release.outputs.tag_name }}-win-${{ matrix.name }}.zip
asset_content_type: application/octet-stream
build-linux-static:
strategy:
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
name: Build ${{ matrix.arch }} Linux static binary
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- 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
- 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-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./par2.xz
asset_name: par2cmdline-turbo-${{ steps.get_release.outputs.tag_name }}-linux-${{ matrix.arch }}.xz
asset_content_type: application/octet-stream
build-mac-x64:
name: Build x64 MacOS binary
runs-on: macos-13
steps:
- uses: ConorMacBride/install-package@v1
with:
# LLVM 18 introduced incompatible change with stock libc++ [https://github.com/Homebrew/homebrew-core/issues/178435#issuecomment-2270106398]
brew: automake llvm@17
# 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
echo "LDFLAGS=-L`brew --prefix llvm`/lib -Wl,-rpath,`brew --prefix llvm`/lib" >> $GITHUB_ENV
echo "CFLAGS=-I`brew --prefix llvm`/include" >> $GITHUB_ENV
echo "CXXFLAGS=-I`brew --prefix llvm`/include" >> $GITHUB_ENV
fi
- uses: actions/checkout@v3
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- run: aclocal && automake --warnings=all --add-missing && autoconf --warnings=all
- run: ./configure
- run: make
- run: strip par2
- run: ./par2 -h
- run: make check
- run: xz -9e --x86 --lzma2 par2
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./par2.xz
asset_name: par2cmdline-turbo-${{ steps.get_release.outputs.tag_name }}-macos-x64.xz
asset_content_type: application/octet-stream
build-mac-arm64:
name: Build arm64 MacOS binary
runs-on: ubuntu-22.04
steps:
# workaround issue with OpenSSL 3.0.2 on 22.04: https://github.com/tpoechtrager/osxcross/issues/349
# issue is fixed in 3.0.7, so grab 3.0.13 from Ubuntu 24.04
- run: |
echo 'deb http://archive.ubuntu.com/ubuntu/ noble main' | sudo tee -a /etc/apt/sources.list.d/noble.list >/dev/null
echo 'APT::Default-Release "jammy";' | sudo tee -a /etc/apt/apt.conf >/dev/null
sudo apt update
sudo apt -t=noble -y install openssl
- uses: mbround18/setup-osxcross@main # OSXCROSS_TARGET unavailable in v1.1
with:
osx-version: "12.3"
- uses: actions/checkout@v3
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- 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
- 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
- run: xz -9e --lzma2 par2
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./par2.xz
asset_name: par2cmdline-turbo-${{ steps.get_release.outputs.tag_name }}-macos-arm64.xz
asset_content_type: application/octet-stream