CI: Add GitHub Actions workflow

This commit is contained in:
tsukumi 2023-05-08 01:17:05 +09:00
parent 88506995ad
commit 8f7cd0386e
3 changed files with 86 additions and 0 deletions

21
.github/workflows/Dockerfile vendored Normal file
View file

@ -0,0 +1,21 @@
ARG IMAGE
FROM ${IMAGE}
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
debhelper \
devscripts \
meson \
pkg-config \
libstdc++6 \
libgbm-dev \
libdrm-dev \
libx11-dev \
libx11-xcb1 \
libxcb-dri2-0 \
libxdamage1 \
libxext6 \
libwayland-client0 && \
rm -rf /var/lib/apt/lists/*
COPY . /src/
WORKDIR /src/

64
.github/workflows/build_and_release.yml vendored Normal file
View file

@ -0,0 +1,64 @@
name: Build and Release Debian Package
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build_and_release:
name: Build and Release Debian Package
runs-on: ubuntu-latest
strategy:
matrix:
image:
- arm64v8/ubuntu
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: linux/arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: docker/build-push-action@v3
with:
context: .github/workflows/
tags: ${{ matrix.image }}:build
# meson >= 0.54.0 is not available in Ubuntu 20.04
build-args: IMAGE=${{ matrix.image }}:22.04
cache-from: type=gha,scope=${{ matrix.image }}
cache-to: type=gha,scope=${{ matrix.image }},mode=max
load: true
- name: Build
run: |
docker run --rm -i -v $(pwd):/work -w /work ${{ matrix.image }}:build bash -c 'debuild -us -uc -b && cp -a ../*.deb ./'
- name: Get version
id: get_version
run: |
echo "version=$(docker run --rm -i -v $(pwd):/work -w /work ${{ matrix.image }}:build bash -c 'dpkg-parsechangelog --show-field Version')" >> $GITHUB_OUTPUT
- name: Get commit hash
id: get_commit_hash
uses: pr-mpt/actions-commit-hash@v2
- name: Release
uses: softprops/action-gh-release@v1
with:
name: v${{ steps.get_version.outputs.version }}-${{ steps.get_commit_hash.outputs.short }}
tag_name: v${{ steps.get_version.outputs.version }}-${{ steps.get_commit_hash.outputs.short }}
generate_release_notes: true
files: |
./*.deb

1
.gitignore vendored
View file

@ -11,4 +11,5 @@
.libs
TAGS
*\.a
libmali-*
debian/libmali-*