From 6aecec2e75863c8e455ba2ad36df2c5b38818189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 8 Jan 2020 23:00:25 +0900 Subject: [PATCH] Add test Arch build --- .github/workflows/release.yml | 57 +++++++++++++++++++++++++++++++++++ pkg/arch/build.sh | 24 +++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100755 pkg/arch/build.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..833536c40 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,57 @@ +on: + push: + branches: + - feature/pkg + # tags: + # - 'v[0-9]+.[0-9]+.[0-9]*' + +name: Create release and upload binaries + +jobs: + build-arch: + name: Build Arch Linux + runs-on: ubuntu-latest + container: archlinux + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Build + run: | + pkg/arch/build.sh + mkdir release + mv pkg/arch/**/*.pkg.tar.zst* release + - name: Upload artifacts + uses: actions/upload-artifact@v1 + with: + name: arch-latest + path: release + release: + name: Create and Upload Release + needs: [build-arch] + runs-on: ubuntu-latest + steps: + - name: Download Arch Linux artifacts + uses: actions/download-artifact@v1 + with: + name: arch-latest + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + draft: false + prerelease: false + + - name: Upload Arch Linux Assets to Release + uses: svenstaro/upload-release-action@v1-release + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ./arch-latest/* + tag: ${{ github.ref }} + overwrite: true + file_glob: true diff --git a/pkg/arch/build.sh b/pkg/arch/build.sh new file mode 100755 index 000000000..26883be0c --- /dev/null +++ b/pkg/arch/build.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +set -euxo pipefail + +# Package compression settings (Matches latest Arch) +export PKGEXT='.pkg.tar.zst' +export COMPRESSZST=(zstd -c -T0 --ultra -20 -) + +# Create user +useradd -m -g wheel -s /bin/sh tester +echo "nobody ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +chown -R nobody:wheel . + +# Install makepkg deps +pacman -Sy sudo binutils fakeroot grep base-devel git --noconfirm + +# Build the packages as `nobody' user +# TODO: use --sign --key +pushd pkg/arch/surface +su nobody -p -s /bin/bash -c 'makepkg -f --syncdeps --skippgpcheck --noconfirm' +popd + +pushd pkg/arch/kernel +# su nobody -p -s /bin/bash -c 'makepkg -f --syncdeps --skippgpcheck --noconfirm' +popd