Disable debug packages generation #69
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: Build ChimeraOS Mesa | |
on: | |
push: | |
branches: [ main ] | |
tags: '*' | |
workflow_dispatch: | |
env: | |
PKGDEST: "/tmp/mesa-chimeraos" | |
BUILDDIR: "/tmp/build" | |
jobs: | |
build-mesa: | |
runs-on: ubuntu-latest | |
outputs: | |
full_version: ${{ steps.set-mesa-version.outputs.full_version }} | |
container: archlinux:base-devel | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Create build user | |
run: | | |
useradd -m build | |
cp -vR common /home/build/common | |
cp -vR mesa /home/build/mesa | |
cp -vR lib32-mesa /home/build/lib32-mesa | |
chown -vR build /home/build/mesa | |
chown -vR build /home/build/lib32-mesa | |
- name: Set up pacman keyring | |
run: | | |
pacman-key --init | |
pacman-key --populate archlinux | |
mkdir -p /etc/gnupg && echo "auto-key-retrieve" >> /etc/gnupg/gpg.conf | |
echo -e "[multilib]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf | |
- name: Set up git | |
run: | | |
pacman -Syu --noconfirm git | |
- name: Generate .SRCINFO | |
run: | | |
su build bash -c "cd /home/build/mesa && makepkg --printsrcinfo > /home/build/mesa/.SRCINFO" | |
su build bash -c "cd /home/build/lib32-mesa && makepkg --printsrcinfo > /home/build/lib32-mesa/.SRCINFO" | |
- name: Customize makepkg.conf | |
run: | | |
sed -i '/BUILDENV/s/check/!check/g' /etc/makepkg.conf | |
sed -i '/OPTIONS/s/debug/!debug/g' /etc/makepkg.conf | |
sed -i -e 's/-march=x86-64/-march=x86-64-v3/g' /etc/makepkg.conf | |
sed -i -e 's/-mtune=generic/-mtune=znver4/g' /etc/makepkg.conf | |
- name: Install dependencies (mesa) | |
run: | | |
pacman -Syu --noconfirm $(sed -n -e 's/^[[:space:]]*\(make\)\?depends\(_x86_64\)\? = \([[:alnum:][:punct:]]*\)[[:space:]]*$/\3/p' /home/build/mesa/.SRCINFO) | |
- name: Build mesa-chimeraos package | |
id: build-mesa-package | |
shell: bash | |
run: | | |
su build bash -c "cd /home/build/mesa && MAKEFLAGS=-j$(nproc) makepkg" | |
- name: Set mesa package version | |
id: set-mesa-version | |
shell: bash | |
run: | | |
. /home/build/mesa/PKGBUILD | |
full_version=${pkgver}-${pkgrel} | |
echo "full_version=$full_version" >> "$GITHUB_OUTPUT" | |
- name: Install dependencies (lib32-mesa) | |
run: | | |
pacman -S --noconfirm $(sed -n -e 's/^[[:space:]]*\(make\)\?depends\(_x86_64\)\? = \([[:alnum:][:punct:]]*\)[[:space:]]*$/\3/p' /home/build/lib32-mesa/.SRCINFO) | |
pacman --noconfirm -U --overwrite '*' /tmp/mesa-chimeraos/*.pkg.tar.zst --ask=4 | |
- name: Build lib32-mesa-chimeraos package | |
id: build-lib32-mesa-package | |
shell: bash | |
run: | | |
su build bash -c "cd /home/build/lib32-mesa && MAKEFLAGS=-j$(nproc) makepkg" | |
- name: Upload package artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mesa-chimeraos | |
path: | | |
${{ env.PKGDEST }}/*.pkg.tar.zst | |
if-no-files-found: error | |
make-release: | |
if: | | |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || | |
(github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') | |
runs-on: ubuntu-latest | |
needs: [build-mesa] | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: mesa-chimeraos | |
path: ${{ env.PKGDEST }} | |
- name: Make release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: mesa-chimeraos-${{needs.build-mesa.outputs.full_version}} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
draft: false | |
prerelease: true | |
fail_on_unmatched_files: true | |
files: | | |
${{ env.PKGDEST }}/*.pkg.tar.zst |