feat: update pkgrel

This commit is contained in:
Ahmad Husen
2021-10-01 22:53:00 +07:00
parent 581d4292cc
commit 3487dc866b
4 changed files with 20 additions and 4 deletions
+2
View File
@@ -31,6 +31,7 @@ jobs:
uses: ./ uses: ./
with: with:
pkgver: '0.4.26' pkgver: '0.4.26'
pkgrel: 2
updpkgsums: true updpkgsums: true
srcinfo: true srcinfo: true
@@ -106,6 +107,7 @@ jobs:
uses: ./ uses: ./
with: with:
pkgver: '0.4.26' pkgver: '0.4.26'
pkgrel: 2
updpkgsums: true updpkgsums: true
srcinfo: true srcinfo: true
+5 -4
View File
@@ -5,9 +5,9 @@
This action allows running tools needed for creating Arch Linux (and AUR) package. This action allows running tools needed for creating Arch Linux (and AUR) package.
Here's what this action can do: Here's what this action can do:
- Update checksums on PKGBUILD file - Update `pkgver`, `pkgrel`, or checksums on PKGBUILD file
- Generate [.SRCINFO](https://wiki.archlinux.org/title/.SRCINFO) based on your PKGBUILD
- Validate PKGBUILD with [namcap](https://wiki.archlinux.org/title/namcap) - 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) - Run [makepkg](https://wiki.archlinux.org/title/Makepkg) with custom flags (rather than default)
## Usage ## 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 | | `path` | String | | `false` | Path where PKGBUILD is located. This path always located under $GITHUB_WORKSPACE |
| `pkgver` | String | | `false` | Update `pkgver` on your PKGBUILD | | `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 | | `updpkgsums` | Boolean | `false` | `false` | Update checksums on your PKGBUILD |
| `srcinfo` | Boolean | `false` | `false` | Generate new .SRCINFO | | `srcinfo` | Boolean | `false` | `false` | Generate new .SRCINFO |
| `namcap` | Boolean | `true` | `false` | Validate PKGBUILD | | `namcap` | Boolean | `true` | `false` | Validate PKGBUILD |
@@ -121,11 +122,11 @@ jobs:
- name: Validate package - name: Validate package
uses: datakrama/archlinux-package-action@v1 uses: datakrama/archlinux-package-action@v1
with: with:
path: $GITHUB_WORKSPACE/package path: package
flags: '-si --noconfirm' flags: '-si --noconfirm'
namcap: false namcap: false
``` ```
## License ## 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)
+5
View File
@@ -15,6 +15,10 @@ inputs:
description: 'Update pkgver on PKGBUILD' description: 'Update pkgver on PKGBUILD'
default: '' default: ''
required: false required: false
pkgrel:
description: 'Update pkgrel on PKGBUILD'
default: ''
required: false
updpkgsums: updpkgsums:
description: 'Update checksums on PKGBUILD' description: 'Update checksums on PKGBUILD'
default: 'false' default: 'false'
@@ -38,6 +42,7 @@ runs:
args: args:
- ${{ inputs.path }} - ${{ inputs.path }}
- ${{ inputs.pkgver }} - ${{ inputs.pkgver }}
- ${{ inputs.pkgrel }}
- ${{ inputs.updpkgsums }} - ${{ inputs.updpkgsums }}
- ${{ inputs.srcinfo }} - ${{ inputs.srcinfo }}
- ${{ inputs.flags }} - ${{ inputs.flags }}
+8
View File
@@ -19,6 +19,14 @@ if [[ -n $INPUT_PKGVER ]]; then
echo "::endgroup::" echo "::endgroup::"
fi 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 # Update checksums
if [[ $INPUT_UPDPKGSUMS == true ]]; then if [[ $INPUT_UPDPKGSUMS == true ]]; then
echo "::group::Updating checksums on PKGBUILD" echo "::group::Updating checksums on PKGBUILD"