linux-surface/.github/workflows/debian.yml
Dorian Stoll 30c9a9caa5
pkg: Allow triggering a CI run manually
This will only build the kernel, sign it and upload it as an artifact.
Useful for testing changes.
2023-07-25 09:36:28 +02:00

125 lines
3.2 KiB
YAML

name: Debian
env:
GPG_KEY_ID: 56C464BAAC421453
on:
push:
tags:
- 'debian-*'
repository_dispatch:
workflow_dispatch:
jobs:
build:
name: Build Kernel
runs-on: ubuntu-latest
steps:
- name: Maximize disk space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 5120
remove-dotnet: true
remove-android: true
remove-docker-images: true
- name: Checkout code
uses: actions/checkout@v3
- name: Initialize containers
run: |
bash ./.github/scripts/container/create.sh \
ubuntu:20.04
- name: Install build dependencies
run: |
bash ./.github/scripts/container/exec.sh \
-- \
bash ./.github/scripts/package/debian.sh setup-builddeps
- name: Setup secureboot certificate
env:
SB_KEY: ${{ secrets.SURFACE_SB_KEY }}
run: |
bash ./.github/scripts/container/exec.sh \
-e SB_KEY \
-- \
bash ./.github/scripts/package/debian.sh setup-secureboot
- name: Build packages
run: |
bash ./.github/scripts/container/exec.sh \
-- \
bash ./.github/scripts/package/debian.sh build-packages
- name: Sign packages
env:
GPG_KEY: ${{ secrets.LINUX_SURFACE_GPG_KEY }}
run: |
bash ./.github/scripts/container/exec.sh \
-e GPG_KEY \
-e GPG_KEY_ID \
-- \
bash ./.github/scripts/package/debian.sh sign-packages
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: debian-latest
path: pkg/debian/release
release:
name: Publish release
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: debian-latest
path: debian-latest
- name: Upload assets
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.LINUX_SURFACE_BOT_TOKEN }}
file: ./*-latest/*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
repo:
name: Update package repository
needs: [release]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: debian-latest
path: debian-latest
- name: Initialize containers
run: |
bash ./.github/scripts/container/create.sh \
debian:sid
- name: Update repository
env:
SURFACEBOT_TOKEN: ${{ secrets.LINUX_SURFACE_BOT_TOKEN }}
GIT_REF: ${{ github.ref }}
BRANCH_STAGING: u/staging
run: |
bash ./.github/scripts/container/exec.sh \
-e SURFACEBOT_TOKEN \
-e GIT_REF \
-e BRANCH_STAGING \
-e GITHUB_REPOSITORY \
-- \
bash ./.github/scripts/repository/debian.sh