libmali-rockchip-tsukumijima/.github/workflows/build.yml
tsukumi a894c6dda6
Some checks are pending
Build and Release Debian Package / Build and Release Debian Package (push) Waiting to run
CI: Rename to build.yml
2026-01-05 22:45:28 +09:00

94 lines
2.9 KiB
YAML

name: Build and Release Debian Package
on:
push:
branches:
- master
workflow_dispatch:
inputs:
commit_sha:
description: 'Target commit SHA to build (full SHA recommended).'
required: true
type: string
jobs:
build-and-release:
name: Build and Release Debian Package
# Run on arm64 hosted runner to avoid QEMU emulation slowness.
runs-on: ubuntu-22.04-arm
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.commit_sha || github.sha }}
- name: Fix Git Permissions
run: |
mkdir -p ~/.config/git
chmod -R 700 ~/.config
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:ubuntu-support-team/meson
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
debhelper \
devscripts \
meson \
pkg-config \
libstdc++6 \
libgbm-dev \
libdrm-dev \
libx11-6 \
libx11-dev \
libx11-xcb1 \
libx11-xcb-dev \
libxcb-dri2-0 \
libxcb-dri2-0-dev \
libxcb-dri3-dev \
libxcb-present-dev \
libxcb-xfixes0-dev \
libxdamage1 \
libxdamage-dev \
libxext6 \
libxext-dev \
libxfixes3 \
libxfixes-dev \
libwayland-client0 \
libwayland-dev
sudo apt-get clean autoclean --yes
sudo apt-get autoremove --yes
sudo rm -rf /var/cache/apt/archives* /var/lib/apt/lists/*
- name: Build Debian package
run: |
debuild -us -uc -b && cp -a ../*.deb ./
- name: Get version
id: get_version
run: |
echo "version=$(dpkg-parsechangelog --show-field Version)" >> $GITHUB_OUTPUT
- name: Get commit metadata
id: get_commit_hash
run: |
echo "date=$(git show -s --format=%cd --date=format:%Y%m%d HEAD)" >> $GITHUB_OUTPUT
echo "full=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
echo "short=$(git rev-parse --short=7 HEAD)" >> $GITHUB_OUTPUT
- name: Release
uses: softprops/action-gh-release@v1
with:
name: v${{ steps.get_version.outputs.version }}-${{ steps.get_commit_hash.outputs.date }}-${{ steps.get_commit_hash.outputs.short }}
tag_name: v${{ steps.get_version.outputs.version }}-${{ steps.get_commit_hash.outputs.date }}-${{ steps.get_commit_hash.outputs.short }}
target_commitish: ${{ steps.get_commit_hash.outputs.full }}
generate_release_notes: true
files: |
./*.deb