diff --git a/action.yml b/action.yml index f926d91..24a52ad 100644 --- a/action.yml +++ b/action.yml @@ -29,6 +29,11 @@ inputs: required: false default: "true" +outputs: + package: + description: "The name of the package file built by this action" + value: ${{ steps.package.outputs.name }} + runs: using: composite steps: @@ -36,42 +41,90 @@ runs: if: inputs.update_package_database == 'true' shell: bash run: | + echo ::group::{Pacman Version} pacman --version + echo ::endgroup:: + + echo ::group::{Pacman Update Package Database Output} sudo pacman -Sy --noconfirm + echo ::endgroup:: - name: Update checksums if: inputs.update_checksum == 'true' shell: bash run: | + echo ::group::{updpkgsums Version} updpkgsums --version + echo ::endgroup:: + + echo ::group::{updpkgsums Output} updpkgsums + echo ::endgroup:: - name: Download & Extract Packages shell: bash run: | + echo ::group::{PKGBUILD File Content} cat PKGBUILD + echo ::endgroup:: + + echo ::group::{makepkg Version} makepkg --version + echo ::endgroup:: + + echo ::group::{Download and Extract Package Output} makepkg -so --noconfirm --needed + echo ::endgroup:: + + echo ::group::{Source Directory Content} ls -la src/ + echo ::endgroup:: - name: Lint PKGBUILD shell: bash if: inputs.lint_pkgbuild == 'true' run: | + echo ::group::{Namcap Version} namcap --version + echo ::endgroup:: + + echo ::group::{Lint Result - PKGBUILD} namcap PKGBUILD + echo ::endgroup:: - name: Build shell: bash run: | + echo ::group::{Build Output} if [ ${{ inputs.install_package }} = 'true' ]; then makepkg -si --skipchecksums --skippgpcheck --noconfirm --needed else makepkg -s --skipchecksums --skippgpcheck --noconfirm --needed fi + echo ::endgroup:: + + echo ::group::{Directory Content After Build} ls -la + echo ::endgroup:: - name: Lint Package(s) if: inputs.lint_package == 'true' 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