From 8ee4d30dbd61a7b7355f72759a1bdca9ef02dd9f Mon Sep 17 00:00:00 2001 From: Giovanni Toraldo Date: Fri, 24 Jan 2025 12:05:39 +0100 Subject: [PATCH 1/4] Add setup-updatecli action --- .github/actions/setup-updatecli/action.yml | 14 ++++++++++++++ .github/dependabot.yml | 8 ++++++++ .github/workflows/test.yml | 1 + .updatecli/values/github_releases/updatecli.yaml | 12 ++++++++++++ docs/README.md | 11 +++++++++++ 5 files changed, 46 insertions(+) create mode 100644 .github/actions/setup-updatecli/action.yml create mode 100644 .updatecli/values/github_releases/updatecli.yaml diff --git a/.github/actions/setup-updatecli/action.yml b/.github/actions/setup-updatecli/action.yml new file mode 100644 index 000000000..9e6c568b7 --- /dev/null +++ b/.github/actions/setup-updatecli/action.yml @@ -0,0 +1,14 @@ +name: 'Setup updatecli' +description: 'Install updatecli binary' +inputs: + version: + description: 'Version of binary' + default: '0.93.0' +runs: + using: "composite" + steps: + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-github-release-binary@v8.11.0 + with: + repo: updatecli/updatecli + version: ${{ inputs.version }} + url_template: 'v${VERSION}/${NAME}_${OS}_${ARCH}.tar.gz' diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f42cd1980..de799bbce 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -585,6 +585,14 @@ updates: catch-all: patterns: - "*" + - package-ecosystem: "github-actions" + directory: "/.github/actions/setup-updatecli" + schedule: + interval: "weekly" + groups: + catch-all: + patterns: + - "*" - package-ecosystem: "github-actions" directory: "/.github/actions/slack-file-upload" schedule: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0d842746b..8786ca9d1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -94,3 +94,4 @@ jobs: - uses: ./.github/actions/free-hosted-runner-disk-space - name: Test if available disk size increased run: test ${{ env.total_size_before }} -lt $(df --total --output=avail | tail -1) + - uses: ./.github/actions/setup-updatecli diff --git a/.updatecli/values/github_releases/updatecli.yaml b/.updatecli/values/github_releases/updatecli.yaml new file mode 100644 index 000000000..fae53333b --- /dev/null +++ b/.updatecli/values/github_releases/updatecli.yaml @@ -0,0 +1,12 @@ +github: + prefix: 'build(deps)' + message: 'bump updatecli to {{ source "lastRelease" }}' + +github_release: + owner: 'updatecli' + repo: 'updatecli' + +target: + file: '.github/actions/setup-updatecli/action.yml' + key: '$.inputs.version.default' + trimprefix: 'v' diff --git a/docs/README.md b/docs/README.md index 6dc4d8c80..f2c0eafb5 100644 --- a/docs/README.md +++ b/docs/README.md @@ -99,6 +99,7 @@ Here follows the list of GitHub Actions topics available in the current document - [setup-rancher-cli](#setup-rancher-cli) - [setup-terraform-docs](#setup-terraform-docs) - [setup-updatebot](#setup-updatebot) + - [setup-updatecli](#setup-updatecli) - [slack-file-upload](#slack-file-upload) - [sonar-scanner](#sonar-scanner) - [update-deployment-runtime-versions](#update-deployment-runtime-versions) @@ -1658,6 +1659,16 @@ Install the updatebot binary from GitHub Releases and add it to the PATH. version: "1.1.60" ``` +### setup-updatecli + +Install the updatecli binary from GitHub Releases and add it to the PATH. + +```yaml + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-updatecli@ref + with: + version: "0.93.0" # omit to use the default version provided by the action +``` + ### slack-file-upload Uploads a file to a Slack channel. From f5d181c0853d2a3b2da45401d0dff0606c1101ca Mon Sep 17 00:00:00 2001 From: Giovanni Toraldo Date: Fri, 24 Jan 2025 12:11:17 +0100 Subject: [PATCH 2/4] add test argument --- .github/actions/setup-github-release-binary/action.yml | 6 +++++- .github/workflows/test.yml | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-github-release-binary/action.yml b/.github/actions/setup-github-release-binary/action.yml index 0f8744e51..1527f8e53 100644 --- a/.github/actions/setup-github-release-binary/action.yml +++ b/.github/actions/setup-github-release-binary/action.yml @@ -11,6 +11,10 @@ inputs: description: 'Template for download url, can use VERSION/NAME/OS/ARCH env vars' required: false default: 'v${VERSION}/${NAME}_${VERSION}_${OS}_${ARCH}.tar.gz' + test_args: + description: 'Arguments to test the binary' + required: false + default: '--version' runs: using: "composite" steps: @@ -27,4 +31,4 @@ runs: echo "Downloading $URL ..." curl -fsSL $URL | tar xz $NAME sudo mv $NAME /usr/local/bin/$NAME - echo $($NAME --version) + $NAME ${{ inputs.test_args }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8786ca9d1..d158c8b55 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -95,3 +95,9 @@ jobs: - name: Test if available disk size increased run: test ${{ env.total_size_before }} -lt $(df --total --output=avail | tail -1) - uses: ./.github/actions/setup-updatecli + - uses: ./.github/actions/setup-github-release-binary + with: + repo: updatecli/updatecli + version: 0.93.0 + url_template: 'v${VERSION}/${NAME}_${OS}_${ARCH}.tar.gz' + test_args: 'version' From 43299c34bc6b084e09eb89e323f7416b3ee5e607 Mon Sep 17 00:00:00 2001 From: Giovanni Toraldo Date: Fri, 24 Jan 2025 12:11:32 +0100 Subject: [PATCH 3/4] bump version --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index e60032250..368fe859d 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v8.11.0 +v8.12.0 From 3480d8d35889b8ed69e74541b15ab4929d211813 Mon Sep 17 00:00:00 2001 From: Giovanni Toraldo Date: Fri, 24 Jan 2025 12:16:09 +0100 Subject: [PATCH 4/4] test --- .github/actions/setup-updatecli/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/setup-updatecli/action.yml b/.github/actions/setup-updatecli/action.yml index 9e6c568b7..9f9e4caaf 100644 --- a/.github/actions/setup-updatecli/action.yml +++ b/.github/actions/setup-updatecli/action.yml @@ -12,3 +12,4 @@ runs: repo: updatecli/updatecli version: ${{ inputs.version }} url_template: 'v${VERSION}/${NAME}_${OS}_${ARCH}.tar.gz' + test_args: 'version'