feat(ci): more grouping

This commit is contained in:
Michael Sasser 2024-12-27 12:17:56 +01:00
parent f63cb4d709
commit fff4b2fef0
Signed by: michael
GPG key ID: 5F653AC7631F5151

View file

@ -29,6 +29,11 @@ inputs:
required: false required: false
default: "true" default: "true"
outputs:
package:
description: "The name of the package file built by this action"
value: ${{ steps.package.outputs.name }}
runs: runs:
using: composite using: composite
steps: steps:
@ -36,42 +41,90 @@ runs:
if: inputs.update_package_database == 'true' if: inputs.update_package_database == 'true'
shell: bash shell: bash
run: | run: |
echo ::group::{Pacman Version}
pacman --version pacman --version
echo ::endgroup::
echo ::group::{Pacman Update Package Database Output}
sudo pacman -Sy --noconfirm sudo pacman -Sy --noconfirm
echo ::endgroup::
- name: Update checksums - name: Update checksums
if: inputs.update_checksum == 'true' if: inputs.update_checksum == 'true'
shell: bash shell: bash
run: | run: |
echo ::group::{updpkgsums Version}
updpkgsums --version updpkgsums --version
echo ::endgroup::
echo ::group::{updpkgsums Output}
updpkgsums updpkgsums
echo ::endgroup::
- name: Download & Extract Packages - name: Download & Extract Packages
shell: bash shell: bash
run: | run: |
echo ::group::{PKGBUILD File Content}
cat PKGBUILD cat PKGBUILD
echo ::endgroup::
echo ::group::{makepkg Version}
makepkg --version makepkg --version
echo ::endgroup::
echo ::group::{Download and Extract Package Output}
makepkg -so --noconfirm --needed makepkg -so --noconfirm --needed
echo ::endgroup::
echo ::group::{Source Directory Content}
ls -la src/ ls -la src/
echo ::endgroup::
- name: Lint PKGBUILD - name: Lint PKGBUILD
shell: bash shell: bash
if: inputs.lint_pkgbuild == 'true' if: inputs.lint_pkgbuild == 'true'
run: | run: |
echo ::group::{Namcap Version}
namcap --version namcap --version
echo ::endgroup::
echo ::group::{Lint Result - PKGBUILD}
namcap PKGBUILD namcap PKGBUILD
echo ::endgroup::
- name: Build - name: Build
shell: bash shell: bash
run: | run: |
echo ::group::{Build Output}
if [ ${{ inputs.install_package }} = 'true' ]; then if [ ${{ inputs.install_package }} = 'true' ]; then
makepkg -si --skipchecksums --skippgpcheck --noconfirm --needed makepkg -si --skipchecksums --skippgpcheck --noconfirm --needed
else else
makepkg -s --skipchecksums --skippgpcheck --noconfirm --needed makepkg -s --skipchecksums --skippgpcheck --noconfirm --needed
fi fi
echo ::endgroup::
echo ::group::{Directory Content After Build}
ls -la ls -la
echo ::endgroup::
- name: Lint Package(s) - name: Lint Package(s)
if: inputs.lint_package == 'true' if: inputs.lint_package == 'true'
shell: bash shell: bash
run: namcap *.pkg.tar.zst run: |
echo ::group::{Lint Result - Package}
namcap *.pkg.tar.zst
echo ::endgroup::
# TODO: Check if there are pre-existing files that match this and exclude them there
- name: Set Output
id: package
shell: bash
run: |
files=(*.pkg.tar.zst)
if [[ "${#files[@]}" == 1 ]]; then
echo "name=${files[0]}" >> $GITHUB_OUTPUT
else
echo "::error title=packages::The number of packages in the output is greater than 1."
exit 1
fi