From 6ed8fc2d2237fc6560ac59064970e7f9d7bfb5d2 Mon Sep 17 00:00:00 2001 From: Michael Sprengel Date: Tue, 12 Dec 2023 17:17:05 +0100 Subject: [PATCH] Download also latest dependencies and rename parameter --- .github/workflows/build_pkg.yml | 18 +++++++++--------- scripts/gh_release | 9 +++++++-- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_pkg.yml b/.github/workflows/build_pkg.yml index 31463d2..7705a1b 100644 --- a/.github/workflows/build_pkg.yml +++ b/.github/workflows/build_pkg.yml @@ -14,15 +14,15 @@ on: build_profiles: type: string default: "" + build_dependencies: + type: string + default: "" source: type: string default: "" debian_source: type: string default: "" - dependencies: - type: string - default: "" email: type: string default: "" @@ -70,11 +70,11 @@ jobs: - name: fetch dependencies run: | mkdir _pkgs - while IFS=@ read -r repo tag; do - ./scripts/gh_release "${{ github.token }}" "$repo" list "$tag" | grep '\.deb$' | while read -r url; do + while IFS=@ read -r repo reference; do + ./scripts/gh_release "${{ github.token }}" "$repo" list "$reference" | grep '\.deb$' | while read -r url; do (cd _pkgs && wget "$url") done - done <<< '${{ inputs.dependencies }}' + done <<< '${{ inputs.build_dependencies }}' ls -lah _pkgs (cd _pkgs && dpkg-scanpackages --multiversion . > Packages) cat _pkgs/Packages @@ -143,11 +143,11 @@ jobs: - name: fetch dependencies run: | mkdir _pkgs - while IFS=@ read -r repo tag; do - ./scripts/gh_release "${{ github.token }}" "$repo" list "$tag" | grep '\.deb$' | while read -r url; do + while IFS=@ read -r repo reference; do + ./scripts/gh_release "${{ github.token }}" "$repo" list "$reference" | grep '\.deb$' | while read -r url; do (cd _pkgs && wget "$url") done - done <<< '${{ inputs.dependencies }}' + done <<< '${{ inputs.build_dependencies }}' ls -lah _pkgs (cd _pkgs && dpkg-scanpackages --multiversion . > Packages) cat _pkgs/Packages diff --git a/scripts/gh_release b/scripts/gh_release index 6c7292e..146bfc0 100755 --- a/scripts/gh_release +++ b/scripts/gh_release @@ -50,8 +50,13 @@ case "$action" in ;; "list") - tag="$1"; shift - get "releases/tags/$tag" | jq -r '.assets[] | .browser_download_url' + reference="$1"; shift + if [[ "$reference" == "latest" ]]; then + api_url="releases/latest" + else + api_url="releases/tags/$reference" + fi + get "$api_url" | jq -r '.assets[] | .browser_download_url' ;; "create")