Merge pull request #52 from dcelasun/feat/add-pgp-support
Add support for loading PGP keys
This commit is contained in:
@@ -26,21 +26,23 @@ jobs:
|
|||||||
|
|
||||||
- name: Get sample package
|
- name: Get sample package
|
||||||
run: |
|
run: |
|
||||||
mkdir visual-studio-code-bin
|
# Spotify 1:1.2.63.394-1
|
||||||
pushd visual-studio-code-bin
|
mkdir spotify
|
||||||
wget https://github.com/dcelasun/pkgbuilds/raw/ee68e4c19c40a0a36a50e289259fcfd94f43786d/visual-studio-code-bin/PKGBUILD
|
pushd spotify
|
||||||
wget https://github.com/dcelasun/pkgbuilds/raw/ee68e4c19c40a0a36a50e289259fcfd94f43786d/visual-studio-code-bin/.SRCINFO
|
wget https://github.com/christian-heusel/aur/raw/5032e51a0b493cb7149264ec27a761ac85c81933/spotify/PKGBUILD
|
||||||
wget https://github.com/dcelasun/pkgbuilds/raw/ee68e4c19c40a0a36a50e289259fcfd94f43786d/visual-studio-code-bin/visual-studio-code-bin.install
|
wget https://github.com/christian-heusel/aur/raw/5032e51a0b493cb7149264ec27a761ac85c81933/spotify/.SRCINFO
|
||||||
wget https://github.com/dcelasun/pkgbuilds/raw/ee68e4c19c40a0a36a50e289259fcfd94f43786d/visual-studio-code-bin/visual-studio-code-bin.sh
|
wget https://github.com/christian-heusel/aur/raw/5032e51a0b493cb7149264ec27a761ac85c81933/spotify/LICENSE
|
||||||
|
wget https://github.com/christian-heusel/aur/raw/5032e51a0b493cb7149264ec27a761ac85c81933/spotify/spotify.protocol
|
||||||
|
wget https://github.com/christian-heusel/aur/raw/5032e51a0b493cb7149264ec27a761ac85c81933/spotify/spotify.sh
|
||||||
popd
|
popd
|
||||||
- name: Running test
|
- name: Running test
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
pkgver: '1.100.1'
|
pkgrel: 2
|
||||||
pkgrel: 1
|
|
||||||
updpkgsums: true
|
updpkgsums: true
|
||||||
srcinfo: true
|
srcinfo: true
|
||||||
path: 'visual-studio-code-bin'
|
path: 'spotify'
|
||||||
|
pgpkeys: 'C85668DF69375001'
|
||||||
|
|
||||||
- name: Show diff
|
- name: Show diff
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
.idea
|
||||||
@@ -22,7 +22,7 @@ Here's what this action can do:
|
|||||||
Following inputs can be used as `step.with` keys
|
Following inputs can be used as `step.with` keys
|
||||||
|
|
||||||
| Name | Type | Default | Required | Description |
|
| Name | Type | Default | Required | Description |
|
||||||
| -------------------------- | ------- | ------------------ | -------- | -------------------------------------------------------------------------------- |
|
|----------------------------|---------|-------------------------------|----------|----------------------------------------------------------------------------------|
|
||||||
| `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 |
|
| `pkgrel` | Integer | | `false` | Update `pkgrel` on your PKGBUILD |
|
||||||
@@ -32,6 +32,8 @@ Following inputs can be used as `step.with` keys
|
|||||||
| `flags` | String | `-cfs --noconfirm` | `false` | Flags after `makepkg` command. Leave this empty will disable this command. |
|
| `flags` | String | `-cfs --noconfirm` | `false` | Flags after `makepkg` command. Leave this empty will disable this command. |
|
||||||
| `aur` | Boolean | `false` | `false` | Resolve dependencies using paru |
|
| `aur` | Boolean | `false` | `false` | Resolve dependencies using paru |
|
||||||
| `update_archlinux_keyring` | Boolean | `true` | `false` | Update the archlinux keyring |
|
| `update_archlinux_keyring` | Boolean | `true` | `false` | Update the archlinux keyring |
|
||||||
|
| `pgpkeys` | String | | `false` | Comma-separated PGP public keys to be loaded before calling makepkg. |
|
||||||
|
| `pgpkeyserver` | String | `hkps://keyserver.ubuntu.com` | `false` | PGP key server address. |
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
|
|||||||
+10
@@ -43,6 +43,14 @@ inputs:
|
|||||||
description: 'Update archlinux-keyring'
|
description: 'Update archlinux-keyring'
|
||||||
default: 'true'
|
default: 'true'
|
||||||
required: false
|
required: false
|
||||||
|
pgpkeys:
|
||||||
|
description: 'Comma-separated pgp keys'
|
||||||
|
default: ''
|
||||||
|
required: false
|
||||||
|
pgpkeyserver:
|
||||||
|
description: 'PGP key server'
|
||||||
|
default: 'hkps://keyserver.ubuntu.com'
|
||||||
|
required: false
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
@@ -57,3 +65,5 @@ runs:
|
|||||||
- ${{ inputs.namcap }}
|
- ${{ inputs.namcap }}
|
||||||
- ${{ inputs.aur }}
|
- ${{ inputs.aur }}
|
||||||
- ${{ inputs.archlinux_keyring }}
|
- ${{ inputs.archlinux_keyring }}
|
||||||
|
- ${{ inputs.pgpkeys }}
|
||||||
|
- ${{ inputs.pgpkeyserver }}
|
||||||
|
|||||||
+12
-4
@@ -9,6 +9,14 @@ cd $HOME
|
|||||||
mkdir gh-action
|
mkdir gh-action
|
||||||
cd gh-action
|
cd gh-action
|
||||||
|
|
||||||
|
if [[ -n $INPUT_PGPKEYS ]]; then
|
||||||
|
echo "::group::Loading PGP keys"
|
||||||
|
for key in ${INPUT_PGPKEYS//,/$'\n'}; do
|
||||||
|
gpg --keyserver $INPUT_PGPKEYSERVER --recv-keys $key
|
||||||
|
done
|
||||||
|
echo "::endgroup::"
|
||||||
|
fi
|
||||||
|
|
||||||
# If there is a custom path, we need to copy the whole repository
|
# If there is a custom path, we need to copy the whole repository
|
||||||
# because we run "git diff" at several stages and without the entire
|
# because we run "git diff" at several stages and without the entire
|
||||||
# tree the output will be incorrect.
|
# tree the output will be incorrect.
|
||||||
@@ -33,7 +41,7 @@ fi
|
|||||||
if [[ -n $INPUT_PKGVER ]]; then
|
if [[ -n $INPUT_PKGVER ]]; then
|
||||||
echo "::group::Updating pkgver on PKGBUILD"
|
echo "::group::Updating pkgver on PKGBUILD"
|
||||||
sed -i "s:^pkgver=.*$:pkgver=$INPUT_PKGVER:g" PKGBUILD
|
sed -i "s:^pkgver=.*$:pkgver=$INPUT_PKGVER:g" PKGBUILD
|
||||||
git diff PKGBUILD
|
git --no-pager diff PKGBUILD
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -41,7 +49,7 @@ fi
|
|||||||
if [[ -n $INPUT_PKGREL ]]; then
|
if [[ -n $INPUT_PKGREL ]]; then
|
||||||
echo "::group::Updating pkgrel on PKGBUILD"
|
echo "::group::Updating pkgrel on PKGBUILD"
|
||||||
sed -i "s:^pkgrel=.*$:pkgrel=$INPUT_PKGREL:g" PKGBUILD
|
sed -i "s:^pkgrel=.*$:pkgrel=$INPUT_PKGREL:g" PKGBUILD
|
||||||
git diff PKGBUILD
|
git --no-pager diff PKGBUILD
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -49,7 +57,7 @@ fi
|
|||||||
if [[ $INPUT_UPDPKGSUMS == true ]]; then
|
if [[ $INPUT_UPDPKGSUMS == true ]]; then
|
||||||
echo "::group::Updating checksums on PKGBUILD"
|
echo "::group::Updating checksums on PKGBUILD"
|
||||||
updpkgsums
|
updpkgsums
|
||||||
git diff PKGBUILD
|
git --no-pager diff PKGBUILD
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -57,7 +65,7 @@ fi
|
|||||||
if [[ $INPUT_SRCINFO == true ]]; then
|
if [[ $INPUT_SRCINFO == true ]]; then
|
||||||
echo "::group::Generating new .SRCINFO based on PKGBUILD"
|
echo "::group::Generating new .SRCINFO based on PKGBUILD"
|
||||||
makepkg --printsrcinfo >.SRCINFO
|
makepkg --printsrcinfo >.SRCINFO
|
||||||
git diff .SRCINFO
|
git --no-pager diff .SRCINFO
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user