Merge pull request #151 from quo/dft-check-group #210
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
tags: | |
- '**' | |
branches: | |
- '**' | |
env: | |
NAME: iptsd | |
SCRIPTS: ./.github/scripts | |
BRANCH_STAGING: u/staging | |
jobs: | |
checkout: | |
name: Prepare workspace | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Archive workspace | |
uses: actions/upload-artifact@v3 | |
with: | |
name: workspace | |
path: . | |
check: | |
name: Check code quality | |
container: fedora:39 | |
runs-on: ubuntu-latest | |
needs: [checkout] | |
steps: | |
- name: Restore workspace | |
uses: actions/download-artifact@v3 | |
with: | |
name: workspace | |
- name: Install build dependencies | |
run: | | |
bash $SCRIPTS/pkg-fedora.sh install | |
dnf install -y clang clang-tools-extra | |
- name: Setup meson | |
env: | |
CC: clang | |
CXX: clang++ | |
run: meson setup build | |
- name: Run clang-format | |
run: bash $SCRIPTS/check-format.sh | |
- name: Run clang-tidy | |
run: bash $SCRIPTS/check-tidy.sh | |
build-arch: | |
name: Build Arch Linux Package | |
container: archlinux/archlinux | |
runs-on: ubuntu-latest | |
needs: [check] | |
steps: | |
- name: Restore workspace | |
uses: actions/download-artifact@v3 | |
with: | |
name: workspace | |
- name: Install dependencies | |
run: bash $SCRIPTS/pkg-arch.sh install | |
- name: Build package | |
run: bash $SCRIPTS/pkg-arch.sh build | |
- name: Sign package | |
env: | |
GPG_KEY_ID: 56C464BAAC421453 | |
GPG_KEY: ${{ secrets.LINUX_SURFACE_GPG_KEY }} | |
run: bash $SCRIPTS/pkg-arch.sh sign | |
- name: Prepare release | |
run: bash $SCRIPTS/pkg-arch.sh release | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: arch-latest | |
path: release | |
build-deb: | |
name: Build Debian Package | |
container: debian:bullseye | |
runs-on: ubuntu-latest | |
needs: [check] | |
steps: | |
- name: Restore workspace | |
uses: actions/download-artifact@v3 | |
with: | |
name: workspace | |
- name: Install dependencies | |
run: bash $SCRIPTS/pkg-debian.sh install | |
- name: Build package | |
run: bash $SCRIPTS/pkg-debian.sh build | |
- name: Sign package | |
env: | |
GPG_KEY_ID: 56C464BAAC421453 | |
GPG_KEY: ${{ secrets.LINUX_SURFACE_GPG_KEY }} | |
run: bash $SCRIPTS/pkg-debian.sh sign | |
- name: Prepare release | |
run: bash $SCRIPTS/pkg-debian.sh release | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: debian-latest | |
path: release | |
build-f39: | |
name: Build Fedora 39 package | |
container: fedora:39 | |
runs-on: ubuntu-latest | |
needs: [check] | |
steps: | |
- name: Restore workspace | |
uses: actions/download-artifact@v3 | |
with: | |
name: workspace | |
- name: Install build dependencies | |
run: bash $SCRIPTS/pkg-fedora.sh install | |
- name: Build package | |
run: bash $SCRIPTS/pkg-fedora.sh build | |
- name: Sign packages | |
env: | |
GPG_KEY_ID: 56C464BAAC421453 | |
GPG_KEY: ${{ secrets.LINUX_SURFACE_GPG_KEY }} | |
run: bash $SCRIPTS/pkg-fedora.sh sign | |
- name: Prepare release | |
run: bash $SCRIPTS/pkg-fedora.sh release | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: fedora-39-latest | |
path: release | |
build-f38: | |
name: Build Fedora 38 package | |
container: fedora:38 | |
runs-on: ubuntu-latest | |
needs: [check] | |
steps: | |
- name: Restore workspace | |
uses: actions/download-artifact@v3 | |
with: | |
name: workspace | |
- name: Install build dependencies | |
run: bash $SCRIPTS/pkg-fedora.sh install | |
- name: Build package | |
run: bash $SCRIPTS/pkg-fedora.sh build | |
- name: Sign packages | |
env: | |
GPG_KEY_ID: 56C464BAAC421453 | |
GPG_KEY: ${{ secrets.LINUX_SURFACE_GPG_KEY }} | |
run: bash $SCRIPTS/pkg-fedora.sh sign | |
- name: Prepare release | |
run: bash $SCRIPTS/pkg-fedora.sh release | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: fedora-38-latest | |
path: release | |
build-f37: | |
name: Build Fedora 37 package | |
container: fedora:37 | |
runs-on: ubuntu-latest | |
needs: [check] | |
steps: | |
- name: Restore workspace | |
uses: actions/download-artifact@v3 | |
with: | |
name: workspace | |
- name: Install build dependencies | |
run: bash $SCRIPTS/pkg-fedora.sh install | |
- name: Build package | |
run: bash $SCRIPTS/pkg-fedora.sh build | |
- name: Sign packages | |
env: | |
GPG_KEY_ID: 56C464BAAC421453 | |
GPG_KEY: ${{ secrets.LINUX_SURFACE_GPG_KEY }} | |
run: bash $SCRIPTS/pkg-fedora.sh sign | |
- name: Prepare release | |
run: bash $SCRIPTS/pkg-fedora.sh release | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: fedora-37-latest | |
path: release | |
release: | |
name: Publish release | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') | |
needs: [build-deb, build-arch, build-f39, build-f38, build-f37] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Debian artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: debian-latest | |
path: debian-latest | |
- name: Download Arch Linux artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: arch-latest | |
path: arch-latest | |
- name: Download Fedora 39 artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: fedora-39-latest | |
path: fedora-39-latest | |
- name: Download Fedora 38 artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: fedora-38-latest | |
path: fedora-38-latest | |
- name: Download Fedora 37 artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: fedora-37-latest | |
path: fedora-37-latest | |
- name: Upload assets | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ./*-latest/* | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true | |
repo-arch: | |
name: Update Arch Linux package repository | |
container: archlinux/archlinux | |
runs-on: ubuntu-latest | |
needs: [release] | |
steps: | |
- name: Restore workspace | |
uses: actions/download-artifact@v3 | |
with: | |
name: workspace | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: arch-latest | |
path: arch-latest | |
- name: Update repository | |
env: | |
SURFACEBOT_TOKEN: ${{ secrets.LINUX_SURFACE_BOT_TOKEN }} | |
GIT_REF: ${{ github.ref }} | |
run: bash $SCRIPTS/repo-arch.sh $NAME | |
repo-deb: | |
name: Update Debian package repository | |
container: debian:bullseye | |
runs-on: ubuntu-latest | |
needs: [release] | |
steps: | |
- name: Restore workspace | |
uses: actions/download-artifact@v3 | |
with: | |
name: workspace | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: debian-latest | |
path: debian-latest | |
- name: Update repository | |
env: | |
SURFACEBOT_TOKEN: ${{ secrets.LINUX_SURFACE_BOT_TOKEN }} | |
GIT_REF: ${{ github.ref }} | |
run: bash $SCRIPTS/repo-debian.sh $NAME | |
repo-f39: | |
name: Update Fedora 39 package repository | |
container: fedora:39 | |
runs-on: ubuntu-latest | |
needs: [release] | |
steps: | |
- name: Restore workspace | |
uses: actions/download-artifact@v3 | |
with: | |
name: workspace | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: fedora-39-latest | |
path: fedora-39-latest | |
- name: Update repository | |
env: | |
SURFACEBOT_TOKEN: ${{ secrets.LINUX_SURFACE_BOT_TOKEN }} | |
GIT_REF: ${{ github.ref }} | |
run: bash $SCRIPTS/repo-fedora.sh $NAME 39 | |
repo-f38: | |
name: Update Fedora 38 package repository | |
container: fedora:38 | |
runs-on: ubuntu-latest | |
needs: [release] | |
steps: | |
- name: Restore workspace | |
uses: actions/download-artifact@v3 | |
with: | |
name: workspace | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: fedora-38-latest | |
path: fedora-38-latest | |
- name: Update repository | |
env: | |
SURFACEBOT_TOKEN: ${{ secrets.LINUX_SURFACE_BOT_TOKEN }} | |
GIT_REF: ${{ github.ref }} | |
run: bash $SCRIPTS/repo-fedora.sh $NAME 38 | |
repo-f37: | |
name: Update Fedora 37 package repository | |
container: fedora:37 | |
runs-on: ubuntu-latest | |
needs: [release] | |
steps: | |
- name: Restore workspace | |
uses: actions/download-artifact@v3 | |
with: | |
name: workspace | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: fedora-37-latest | |
path: fedora-37-latest | |
- name: Update repository | |
env: | |
SURFACEBOT_TOKEN: ${{ secrets.LINUX_SURFACE_BOT_TOKEN }} | |
GIT_REF: ${{ github.ref }} | |
run: bash $SCRIPTS/repo-fedora.sh $NAME 37 |