Files
distribution/.github/workflows/test.yml
Igor Pečovnik ae92cf4600 Update test.yml
2022-08-03 22:03:20 +02:00

51 lines
1.6 KiB
YAML

name: Make index
#
# Generates index
#
on:
workflow_dispatch:
workflow_run:
workflows: ["Build train"]
types:
- completed
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Make build list
run: |
sudo npm install --location=global json || true
truncate README.me --size=0 || true
echo "| Image | GPG | SHA | Branch | Variant | Kernel |" >> README.tmp
echo "| --- | :--: | :--: | :--: | :--: | --- |" >> README.tmp
gh release view $(gh release list | awk '{print $1}' | head -1) --json assets 2>/dev/null | python3 -mjson.tool | sed '1,2d;$d' | json -ga name url -d, | sort | (
while read -r line; do
name=$(echo $line | cut -d"," -f1)
url=$(echo $line | cut -d"," -f2)
if [ "${name: -3}" == ".xz" ]; then
out_name=$(echo $name | cut -d"_" -f3)
out_branch=$(echo $name | cut -d"_" -f4)
out_kernel=$(echo $name | cut -d"_" -f6-7 | cut -d"." -f1-3 | cut -d"_" -f1)
out_desktop=$(echo $name | cut -d"_" -f7)
out_desktop=${out_desktop:-cli}
echo -ne "| [$out_name]($url) | [:file_folder:]($url".asc") | [:file_folder:]($url".sha") | $out_branch | $out_desktop | $out_kernel |\n" >> README.tmp
fi
done
)
- uses: actions/upload-artifact@v3
with:
path: README.tmp
name: assets
if-no-files-found: ignore