From 81fcdf41c0ebb60b54e57e23f8543253afcb972c Mon Sep 17 00:00:00 2001 From: spvkgn Date: Sat, 10 Aug 2024 16:31:56 +0500 Subject: [PATCH] Alpine workflow --- .github/workflows/build-alpine.yml | 65 ++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/build-alpine.yml diff --git a/.github/workflows/build-alpine.yml b/.github/workflows/build-alpine.yml new file mode 100644 index 0000000..610474b --- /dev/null +++ b/.github/workflows/build-alpine.yml @@ -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