v1.1.1 #8
Workflow file for this run
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
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: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-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 | |
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-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 | |
- 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 | |
# 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 | |
- 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 |