Merge pull request #50 from spvkgn/actions-alpine-static

Alpine workflow
This commit is contained in:
Vadim Vetrov 2024-08-10 05:50:18 -07:00 committed by GitHub
commit 75b7fe3011
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

65
.github/workflows/build-alpine.yml vendored Normal file
View File

@ -0,0 +1,65 @@
name: Alpine
on:
push:
branches:
- main
jobs:
build:
name: build ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# arch: [x86_64, x86, aarch64, armhf, armv7, ppc64le, s390x]
arch: [x86_64, x86, aarch64, armhf]
os: [ubuntu-latest]
branch: [latest-stable]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up ccache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.ccache
key: ccache-${{ matrix.arch }}-${{ github.run_id }}
restore-keys: ccache-${{ matrix.arch }}-
- name: Set up Alpine Linux for ${{ matrix.arch }}
uses: jirutka/setup-alpine@v1
with:
arch: ${{ matrix.arch }}
branch: ${{ matrix.branch }}
packages: >
bash build-base ccache coreutils findutils gawk git grep tar wget xz
autoconf automake libtool pkgconf linux-headers
shell-name: alpine.sh
- name: Build inside chroot
id: build
env:
ARCH: ${{ matrix.arch }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
PKG_REV: ${{ github.sha }}
shell: alpine.sh {0}
run: |
PKG_REV=$(echo $PKG_REV | cut -c1-7)
case $ARCH in
x86_64) PLATFORM=x64 ;;
x86) PLATFORM=x86 ;;
aarch64) PLATFORM=arm64 ;;
armhf) PLATFORM=arm ;;
*) PLATFORM=$ARCH ;;
esac
make -j$(nproc) CC="ccache gcc -static-libgcc -static" || exit 1
strip -s build/youtubeUnblock
tar -C build -cJvf "youtubeUnblock-$PKG_REV-$PLATFORM.tar.xz" youtubeUnblock
ccache --show-stats
- name: Upload artifacts
if: steps.build.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: ${{ github.workflow }}-${{ matrix.arch }}
path: ./**/youtubeUnblock*.tar.xz