From 6ed8fc2d2237fc6560ac59064970e7f9d7bfb5d2 Mon Sep 17 00:00:00 2001 From: Michael Sprengel Date: Tue, 12 Dec 2023 17:17:05 +0100 Subject: [PATCH 1/2] 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") From d64502cbb5c0b741238bf8c9949b7f4e1768b52c Mon Sep 17 00:00:00 2001 From: Michael Sprengel Date: Tue, 12 Dec 2023 17:40:39 +0100 Subject: [PATCH 2/2] Add documentation to changed parameter --- docs/workflow.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflow.md b/docs/workflow.md index ef444bc..1f0620a 100644 --- a/docs/workflow.md +++ b/docs/workflow.md @@ -51,7 +51,6 @@ Input Parameters available in `build_pkg.yml`: | --------- | ---- | ------------| |`ref`|**Type:** string
**Default:** `${{ github.sha }}`| The ref (commit or branch) that should be checked out from the `package-build` repo while processing the package build.| |`build_container`|**Type:** string
**Default:** `ghcr.io/gardenlinux/package-build`| The container image used for building the package.| -|`dependencies`|**Type:** string| Comma-separated list of repositories and tags to fetch dependencies from.| |`source`|**Type:** string| The source name of the package. There are three values that one can choose from:
- Debian Source Package: `{SOURCE PACKAGE NAME}`
- Git Source: `git+{GIT URL}`
- Native Build: `native`| |`debian_source`|**Type:** string| Defines from which source the `debian/` directory should be used. There are three values that one can choose from:
- Debian Source Package: `{SOURCE PACKAGE NAME}`
- Git Source: `git+{GIT URL}`
- Native Build: `native`| |`email`|**Type:** string
**Default:** `contact@gardenlinux.io`| The Debian package maintainer email.| @@ -60,6 +59,7 @@ Input Parameters available in `build_pkg.yml`: |`message`|**Type:** string
**Default:** `Rebuild for Garden Linux.`| The changelog entry message for the package build.| |`build_option`|**Type:** string| Additional build options for the package build. Build option `terse` is always set.| |`build_profiles`|**Type:** string| Additional build profiles for the package build.| +|`build_dependencies`|**Type:** string| List of build dependencies that should be included in the build. Each new line is a new dependency.

The format looks like this:
`{REPO}@{"latest" \| GIT TAG}`
`gardenlinux/package-libyang2@latest`
`gardenlinux/package-libyang2@gardenlinux/2.1.128-0gardenlinux0`| |`git_filter`|**Type:** string
**Default:** `.*`
**Scope:** `source: git`| This parameter let's you filter Git tags that should be skipped for the upstream version determination. | |`git_tag_match`|**Type:** string
**Default:** `(.*)`
**Scope:** `source: git`| This parameter defines what part of a given Git Tag is considered to be the upstream version. The first regex match group is always the designated upstream version. |