2020-01-08 14:00:25 +00:00
|
|
|
on:
|
|
|
|
push:
|
2020-01-12 04:45:43 +00:00
|
|
|
tags:
|
|
|
|
- 'test'
|
|
|
|
# - 'v*+'
|
2020-01-08 14:00:25 +00:00
|
|
|
|
2020-01-12 09:28:31 +00:00
|
|
|
name: Create kernel release and upload binaries
|
2020-01-08 14:00:25 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-arch:
|
2020-01-12 09:28:31 +00:00
|
|
|
name: Build Arch Linux Kernel
|
2020-01-08 14:00:25 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: archlinux
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
2020-01-12 04:45:43 +00:00
|
|
|
cd pkg/arch/kernel
|
2020-01-10 01:25:28 +00:00
|
|
|
|
|
|
|
# Create build user (can't makepkg as root)
|
2020-01-09 00:42:47 +00:00
|
|
|
useradd -m -g wheel -s /bin/bash build
|
|
|
|
echo "build ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
|
|
|
chown -R build:wheel .
|
|
|
|
|
|
|
|
# Install makepkg deps
|
|
|
|
pacman -Sy sudo binutils fakeroot grep base-devel git --noconfirm
|
|
|
|
|
2020-01-12 04:45:43 +00:00
|
|
|
# Package compression settings (Matches latest Arch)
|
|
|
|
export PKGEXT='.pkg.tar.zst'
|
|
|
|
export COMPRESSZST=(zstd -c -T0 --ultra -20 -)
|
|
|
|
export MAKEFLAGS="-j2"
|
|
|
|
|
2020-01-09 00:42:47 +00:00
|
|
|
# Build
|
2020-01-12 04:45:43 +00:00
|
|
|
su build --pty -p -s /bin/bash -c 'makepkg -f --syncdeps --skippgpcheck --noconfirm'
|
2020-01-10 01:25:28 +00:00
|
|
|
|
|
|
|
- name: Prepare Release
|
|
|
|
run: |
|
2020-01-08 14:00:25 +00:00
|
|
|
mkdir release
|
2020-01-12 04:45:43 +00:00
|
|
|
mv pkg/arch/kernel/*.pkg.tar.zst release
|
2020-01-10 01:25:28 +00:00
|
|
|
|
|
|
|
- name: Sign Packages
|
|
|
|
env:
|
|
|
|
GPG_KEY: ${{ secrets.GITHUB_GPG_KEY }}
|
|
|
|
GPG_PASSPHRASE: ${{ secrets.GITHUB_GPG_PASSPHRASE }}
|
|
|
|
run: |
|
|
|
|
cd release
|
|
|
|
|
|
|
|
# import GPG key
|
|
|
|
echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
|
|
|
|
export GPG_TTY=$(tty)
|
|
|
|
|
|
|
|
# sign packages
|
|
|
|
ls *.pkg.tar.zst | xargs -L1 gpg --detach-sign --batch --no-tty --pinentry-mode=loopback --passphrase $GPG_PASSPHRASE -u 5B574D1B513F9A05
|
2020-01-09 00:42:47 +00:00
|
|
|
|
2020-01-08 14:00:25 +00:00
|
|
|
- name: Upload artifacts
|
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
with:
|
|
|
|
name: arch-latest
|
|
|
|
path: release
|
2020-01-12 09:28:31 +00:00
|
|
|
|
|
|
|
build-fedora:
|
|
|
|
name: Build Fedora Kernel
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: fedora:31
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Decrypt certificates
|
|
|
|
env:
|
|
|
|
LS_PASSWORD: ${{ secrets.LS_PASSWORD }}
|
|
|
|
run: |
|
|
|
|
pushd pkg/secrets
|
|
|
|
./decrypt.sh -p "$LS_PASSWORD" -f gpg/surface_gpg.key.gpg
|
|
|
|
./decrypt.sh -p "$LS_PASSWORD" -f sb/surface_sb.key.gpg
|
|
|
|
popd
|
|
|
|
|
|
|
|
- name: Install certificates
|
|
|
|
run: |
|
|
|
|
gpg --no-tty --batch --yes --import pkg/secrets/gpg/surface_gpg.key
|
|
|
|
cp pkg/secrets/sb/surface_sb.key pkg/fedora/kernel-surface/surface.key
|
|
|
|
cp pkg/secrets/sb/surface_sb.crt pkg/fedora/kernel-surface/surface.crt
|
|
|
|
|
|
|
|
- name: Install build dependencies
|
|
|
|
run: |
|
|
|
|
dnf distro-sync -y
|
|
|
|
dnf install -y rpmdevtools findutils openssl openssl-devel kmod \
|
|
|
|
patch bash tar git-core sbsigntools bzip2 xz findutils gzip m4 \
|
|
|
|
diffutils perl-interpreter perl-Carp perl-devel perl-generators \
|
|
|
|
make gawk gcc binutils redhat-rpm-config hmaccalc bison flex \
|
|
|
|
net-tools hostname bc elfutils-devel python3-devel rpm-sign
|
|
|
|
|
|
|
|
- name: Build packages
|
|
|
|
run: |
|
|
|
|
pushd pkg/fedora/kernel-surface
|
|
|
|
../makerpm -sk linux-surface
|
|
|
|
popd
|
|
|
|
|
|
|
|
- name: Upload artifacts
|
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
with:
|
|
|
|
name: fedora-latest
|
|
|
|
path: pkg/fedora/kernel-surface/out/x86_64
|
|
|
|
|
2020-01-08 14:00:25 +00:00
|
|
|
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
|
|
|
|
|
2020-01-12 09:28:31 +00:00
|
|
|
- name: Download Fedora artifacts
|
|
|
|
uses: actions/download-artifact@v1
|
|
|
|
with:
|
|
|
|
name: fedora-latest
|
|
|
|
|
2020-01-08 14:00:25 +00:00
|
|
|
- name: Create Release
|
|
|
|
id: create_release
|
|
|
|
uses: actions/create-release@v1
|
|
|
|
env:
|
2020-01-10 14:09:31 +00:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_BOT_TOKEN }}
|
2020-01-08 14:00:25 +00:00
|
|
|
with:
|
|
|
|
tag_name: ${{ github.ref }}
|
|
|
|
release_name: ${{ github.ref }}
|
2020-01-12 04:45:43 +00:00
|
|
|
draft: true
|
2020-01-08 14:00:25 +00:00
|
|
|
prerelease: false
|
|
|
|
|
2020-01-12 09:28:31 +00:00
|
|
|
- name: Upload Assets to Release
|
2020-01-08 14:00:25 +00:00
|
|
|
uses: svenstaro/upload-release-action@v1-release
|
|
|
|
with:
|
2020-01-10 14:09:31 +00:00
|
|
|
repo_token: ${{ secrets.GITHUB_BOT_TOKEN }}
|
2020-01-12 09:28:31 +00:00
|
|
|
file: ./*-latest/*
|
2020-01-08 14:00:25 +00:00
|
|
|
tag: ${{ github.ref }}
|
|
|
|
overwrite: true
|
|
|
|
file_glob: true
|