diff --git a/README.md b/README.md index a7062ed..77e945e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,50 @@ -# makepkg +# `makepkg`-Action + +This action builds Arch packages. It is meant to be run inside an `archlinux` +container, like the one we provide at +[aur/runner-image](https://git.michaelsasser.org/aur/runner-image), which comes +with all the necessary tools. Alternatively you could install the necessary +tools yourself before running this action. + +## inputs + +| Name | Default | Required | Description | +| ------------------------- | -------- | -------- | ------------------------------------------------ | +| `update_package_database` | `'true'` | No | Download fresh package databases before building | +| `update_checksum` | `'true'` | No | Update the checksum before building the package | +| `lint_pkgbuild` | `'true'` | No | Run namecap on the PKGBUILD | +| `install_package` | `'true'` | No | Install the package after it was built | +| `lint_package` | `'true'` | No | Run namecap on the resulting package | + +## Example usage + +```yaml +jobs: + build: + name: Build & Lint + runs-on: ubuntu-latest-amd64 + container: + image: "git.michaelsasser.org/aur/runner-image:latest" + credentials: + username: ${{ vars.USERNAME_ACTIONS }} + password: ${{ secrets.PERSONAL_ACCESS_TOKEN_ACTIONS }} + + steps: + - name: Checkout + uses: https://git.michaelsasser.org/actions/checkout@v4 + + - name: Build Package + uses: https://git.michaelsasser.org/actions/makepkg@main +``` + +## Semantic Versioning and Branching Model + +This action uses [SemVer](https://semver.org/) for its release cycle and +follows the +[GitHub Flow](https://docs.github.com/en/get-started/using-github/github-flow). + +## License + +Copyright © 2020-2001 Michael Sasser . Released +under the MIT license. -Build Arch Packages \ No newline at end of file diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..f926d91 --- /dev/null +++ b/action.yml @@ -0,0 +1,77 @@ +--- +name: makepkg +description: Build Arch Linux Packages. +author: Michael Sasser + +branding: + icon: shield + color: blue + +inputs: + update_package_database: + description: Download fresh package databases before building. + required: false + default: "true" + update_checksum: + description: Update the checksum before building the package. + required: false + default: "true" + lint_pkgbuild: + description: Run namecap on the PKGBUILD. + required: false + default: "true" + install_package: + description: Install the package after it was built. + required: false + default: "true" + lint_package: + description: Run namecap on the resulting package. + required: false + default: "true" + +runs: + using: composite + steps: + - name: Update Package Database + if: inputs.update_package_database == 'true' + shell: bash + run: | + pacman --version + sudo pacman -Sy --noconfirm + + - name: Update checksums + if: inputs.update_checksum == 'true' + shell: bash + run: | + updpkgsums --version + updpkgsums + + - name: Download & Extract Packages + shell: bash + run: | + cat PKGBUILD + makepkg --version + makepkg -so --noconfirm --needed + ls -la src/ + + - name: Lint PKGBUILD + shell: bash + if: inputs.lint_pkgbuild == 'true' + run: | + namcap --version + namcap PKGBUILD + + - name: Build + shell: bash + run: | + if [ ${{ inputs.install_package }} = 'true' ]; then + makepkg -si --skipchecksums --skippgpcheck --noconfirm --needed + else + makepkg -s --skipchecksums --skippgpcheck --noconfirm --needed + fi + ls -la + + - name: Lint Package(s) + if: inputs.lint_package == 'true' + shell: bash + run: namcap *.pkg.tar.zst