From 3487dc866bf9b330cb1d4f78d5b119635eacb3b9 Mon Sep 17 00:00:00 2001 From: Ahmad Husen Date: Fri, 1 Oct 2021 22:53:00 +0700 Subject: [PATCH] feat: update pkgrel --- .github/workflows/main.yml | 2 ++ README.md | 9 +++++---- action.yml | 5 +++++ entrypoint.sh | 8 ++++++++ 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 23db7e1..8a1cc0d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,6 +31,7 @@ jobs: uses: ./ with: pkgver: '0.4.26' + pkgrel: 2 updpkgsums: true srcinfo: true @@ -106,6 +107,7 @@ jobs: uses: ./ with: pkgver: '0.4.26' + pkgrel: 2 updpkgsums: true srcinfo: true diff --git a/README.md b/README.md index ff178ce..38d2e5d 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ This action allows running tools needed for creating Arch Linux (and AUR) package. Here's what this action can do: -- Update checksums on PKGBUILD file -- Generate [.SRCINFO](https://wiki.archlinux.org/title/.SRCINFO) based on your PKGBUILD +- Update `pkgver`, `pkgrel`, or checksums on PKGBUILD file - Validate PKGBUILD with [namcap](https://wiki.archlinux.org/title/namcap) +- Generate [.SRCINFO](https://wiki.archlinux.org/title/.SRCINFO) based on your PKGBUILD - Run [makepkg](https://wiki.archlinux.org/title/Makepkg) with custom flags (rather than default) ## Usage @@ -25,6 +25,7 @@ Following inputs can be used as `step.with` keys |-------------------|-----------|-------------------------------|-----------|---------------------------------------| | `path` | String | | `false` | Path where PKGBUILD is located. This path always located under $GITHUB_WORKSPACE | | `pkgver` | String | | `false` | Update `pkgver` on your PKGBUILD | +| `pkgrel` | Integer | | `false` | Update `pkgrel` on your PKGBUILD | | `updpkgsums` | Boolean | `false` | `false` | Update checksums on your PKGBUILD | | `srcinfo` | Boolean | `false` | `false` | Generate new .SRCINFO | | `namcap` | Boolean | `true` | `false` | Validate PKGBUILD | @@ -121,11 +122,11 @@ jobs: - name: Validate package uses: datakrama/archlinux-package-action@v1 with: - path: $GITHUB_WORKSPACE/package + path: package flags: '-si --noconfirm' namcap: false ``` ## License -The scripts and documentation in this project are released under the [MIT License](./LICENSE) +The scripts and documentation in this project are released under the [MIT License](LICENSE) diff --git a/action.yml b/action.yml index 4755195..9944c22 100644 --- a/action.yml +++ b/action.yml @@ -15,6 +15,10 @@ inputs: description: 'Update pkgver on PKGBUILD' default: '' required: false + pkgrel: + description: 'Update pkgrel on PKGBUILD' + default: '' + required: false updpkgsums: description: 'Update checksums on PKGBUILD' default: 'false' @@ -38,6 +42,7 @@ runs: args: - ${{ inputs.path }} - ${{ inputs.pkgver }} + - ${{ inputs.pkgrel }} - ${{ inputs.updpkgsums }} - ${{ inputs.srcinfo }} - ${{ inputs.flags }} diff --git a/entrypoint.sh b/entrypoint.sh index 2f76a4a..1438df5 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,6 +19,14 @@ if [[ -n $INPUT_PKGVER ]]; then echo "::endgroup::" fi +# Update pkgver +if [[ -n $INPUT_PKGREL ]]; then + echo "::group::Updating pkgrel on PKGBUILD" + sed -i "s:^pkgrel=.*$:pkgrel=$INPUT_PKGREL:g" PKGBUILD + git diff PKGBUILD + echo "::endgroup::" +fi + # Update checksums if [[ $INPUT_UPDPKGSUMS == true ]]; then echo "::group::Updating checksums on PKGBUILD"