Update workflow

This commit is contained in:
2026-02-06 00:41:42 +03:00
parent 8a7f3eaf16
commit 55c97eb708
9 changed files with 239 additions and 11 deletions

View File

@@ -0,0 +1,34 @@
name: "Copy the latest ebuild for the package as version given"
description: "Checks if the ebuild with the specified version exists and if not - copies the latest existing one over"
inputs:
atom:
description: "category/name package atom"
required: true
version:
description: "the desired version of the ebuild"
required: true
outputs:
message:
description: "space separated list of versions added"
value: ${{ steps.copy.outputs.message }}
runs:
using: composite
steps:
- id: copy
shell: bash
run: |
set -euo pipefail
ebuild_dir="./${{ inputs.atom }}"
name=$(basename "${{ inputs.atom }}")
want_ebuild="${ebuild_dir}/${name}-${{ inputs.version }}.ebuild"
message=""
if [[ -f "${want_ebuild}" ]]; then
echo "Ebuild already exists"
else
existing_ebuilds=( "${ebuild_dir}"/*.ebuild )
latest_existing_ebuild="${existing_ebuilds[-1]}"
echo "Copying ${latest_existing_ebuild} to ${want_ebuild}"
cp "${latest_existing_ebuild}" "${want_ebuild}"
message="added ${{ inputs.version }}"
fi
echo "message=${message}" >> "${GITHUB_OUTPUT}"