2020-01-22 20:22:20 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- 'fedora-31-*'
|
|
|
|
|
|
|
|
name: Fedora 31
|
|
|
|
|
|
|
|
env:
|
|
|
|
GPG_KEY_ID: 56C464BAAC421453
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build Kernel
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: fedora:31
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install build dependencies
|
|
|
|
run: |
|
|
|
|
dnf distro-sync -y
|
|
|
|
dnf install -y rpmdevtools rpm-sign 'dnf-command(builddep)'
|
|
|
|
dnf builddep -y pkg/fedora/kernel-surface/kernel-surface.spec
|
|
|
|
|
|
|
|
- name: Setup secureboot certificate
|
|
|
|
env:
|
|
|
|
SB_KEY: ${{ secrets.SURFACE_SB_KEY }}
|
|
|
|
run: |
|
|
|
|
cd pkg
|
|
|
|
|
|
|
|
# Install the surface secureboot certificate
|
|
|
|
echo "$SB_KEY" | base64 -d > fedora/kernel-surface/surface.key
|
|
|
|
cp keys/surface.crt fedora/kernel-surface/surface.crt
|
|
|
|
|
|
|
|
- name: Build packages
|
|
|
|
run: |
|
|
|
|
cd pkg/fedora/kernel-surface
|
|
|
|
|
|
|
|
# Build the .rpm packages
|
|
|
|
../makerpm
|
|
|
|
|
|
|
|
- name: Sign packages
|
|
|
|
env:
|
|
|
|
GPG_KEY: ${{ secrets.SURFACE_GPG_KEY }}
|
|
|
|
run: |
|
|
|
|
cd pkg/fedora/kernel-surface/out/x86_64
|
|
|
|
|
|
|
|
# import GPG key
|
|
|
|
echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
|
|
|
|
|
|
|
|
# sign packages
|
|
|
|
rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
|
|
|
|
|
|
|
|
- name: Upload artifacts
|
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
with:
|
|
|
|
name: fedora-31-latest
|
|
|
|
path: pkg/fedora/kernel-surface/out/x86_64
|
|
|
|
|
|
|
|
repo:
|
|
|
|
name: Update package repository
|
|
|
|
needs: [build]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: fedora:31
|
|
|
|
steps:
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2020-01-23 23:22:32 +00:00
|
|
|
dnf install -y createrepo_c git findutils wget
|
2020-01-22 20:22:20 +00:00
|
|
|
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
repository: linux-surface/repo
|
|
|
|
token: ${{ secrets.GITHUB_BOT_TOKEN }}
|
|
|
|
fetch-depth: 0
|
|
|
|
ref: master
|
|
|
|
|
2020-01-23 23:22:32 +00:00
|
|
|
- name: Unpack repository
|
|
|
|
run: |
|
|
|
|
cd fedora/f31
|
|
|
|
|
|
|
|
for blob in $(find . -name '*.blob'); do
|
2020-02-06 22:55:04 +00:00
|
|
|
blobref="$(cat $blob)"
|
|
|
|
repo="${blobref%%:*}"
|
|
|
|
vers="${blobref#*:}"
|
|
|
|
wget "https://github.com/linux-surface/$repo/releases/download/$vers"
|
2020-01-23 23:22:32 +00:00
|
|
|
done
|
|
|
|
|
2020-01-22 20:22:20 +00:00
|
|
|
- name: Download artifacts
|
|
|
|
uses: actions/download-artifact@v1
|
|
|
|
with:
|
|
|
|
name: fedora-31-latest
|
|
|
|
|
|
|
|
- name: Update repository
|
|
|
|
env:
|
|
|
|
GPG_KEY: ${{ secrets.SURFACE_GPG_KEY }}
|
|
|
|
GIT_REF: ${{ github.ref }}
|
|
|
|
run: |
|
2020-02-04 18:14:03 +00:00
|
|
|
# Parse git tag from ref
|
|
|
|
GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
|
|
|
|
|
2020-01-23 23:22:32 +00:00
|
|
|
for pkg in $(find fedora-31-latest -name '*.rpm'); do
|
2020-02-04 19:40:36 +00:00
|
|
|
echo "linux-surface:$GIT_TAG/$(basename $pkg)" > $pkg.blob
|
2020-01-23 23:22:32 +00:00
|
|
|
done
|
|
|
|
|
2020-01-22 20:22:20 +00:00
|
|
|
cp fedora-31-latest/* fedora/f31/
|
|
|
|
rm -r fedora-31-latest
|
|
|
|
|
|
|
|
cd fedora/f31
|
|
|
|
createrepo_c --xz --update --verbose .
|
|
|
|
|
|
|
|
# Sign the updated repository
|
|
|
|
echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
|
|
|
|
if [ -f 'repodata/repomd.xml.asc' ]; then
|
2020-01-23 00:56:47 +00:00
|
|
|
rm repodata/repomd.xml.asc
|
2020-01-22 20:22:20 +00:00
|
|
|
fi
|
|
|
|
gpg --detach-sign --batch --no-tty --armor -u $GPG_KEY_ID repodata/repomd.xml
|
|
|
|
|
|
|
|
- name: Commit and push
|
|
|
|
uses: github-actions-x/commit@v2.3
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_BOT_TOKEN }}
|
|
|
|
push-branch: master
|
|
|
|
commit-message: Update f31 kernel
|
|
|
|
force-add: false
|
|
|
|
rebase: true
|
|
|
|
files: fedora/f31/*
|
|
|
|
name: surfacebot
|
|
|
|
email: surfacebot@users.noreply.github.com
|
|
|
|
|
|
|
|
release:
|
|
|
|
name: Publish release
|
|
|
|
needs: [repo]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Download artifacts
|
|
|
|
uses: actions/download-artifact@v1
|
|
|
|
with:
|
|
|
|
name: fedora-31-latest
|
|
|
|
|
|
|
|
- name: Upload assets
|
|
|
|
uses: svenstaro/upload-release-action@v1-release
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_BOT_TOKEN }}
|
|
|
|
file: ./*-latest/*
|
|
|
|
tag: ${{ github.ref }}
|
|
|
|
overwrite: true
|
|
|
|
file_glob: true
|