From 34dfed162e220d6cdbb13b8910a78ff3d00d1f08 Mon Sep 17 00:00:00 2001 From: Wayne Starr Date: Mon, 9 Dec 2024 14:07:02 -0700 Subject: [PATCH 1/2] chore: add a renovate rule for handling uds versions from upstream ones (#359) --- config/renovate.json5 | 16 ++++++++++++++++ releaser.yaml | 12 ++++++------ tasks.yaml | 2 -- tasks/publish.yaml | 2 +- tasks/upgrade.yaml | 3 +++ 5 files changed, 26 insertions(+), 9 deletions(-) diff --git a/config/renovate.json5 b/config/renovate.json5 index a709c32e..4f620e5a 100644 --- a/config/renovate.json5 +++ b/config/renovate.json5 @@ -92,6 +92,22 @@ ], "datasourceTemplate": "npm" }, + // Matches specified datasources where a uds.x package version needs to be updated from an upstream source + { + "fileMatch": [".*\\.ya?ml$"], + "matchStringsStrategy": "recursive", + "matchStrings": [ + // Test: https://regex101.com/r/a7CxKB/1 + "# renovate-uds: datasource=(?.*?) depName=(?.*?)( versioning=(?.*?))?( extractVersion=(?.*?))?( registryUrl=(?.*?))?\\s.*:\\s*['\"]?[v0-9].*?['\"]?(\\s|$)", + // Test: https://regex101.com/r/TIh2K7/1 + ":\\s*['\"]?[v0-9].*?['\"]?(\\s|$)", + // Test: https://regex101.com/r/euvVHz/1 + "(?[v0-9][^\\n\\\"\\s]*)-uds\\.\\d+" + ], + "autoReplaceStringTemplate": "{{{newValue}}}-uds.0", + "versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver-coerced{{/if}}", + "extractVersionTemplate": "{{#if extractVersion}}{{{extractVersion}}}{{else}}^(?.*)${{/if}}" + }, // Matches specified datasources where a colon separates the version on the following line (i.e. https://github.com/defenseunicorns/zarf/blob/7e91d3b9823b52fe6d0f563d692c8af57faa6005/examples/big-bang/zarf.yaml#L5) { "fileMatch": [".*\\.ya?ml$"], diff --git a/releaser.yaml b/releaser.yaml index 1fc7b425..88e99860 100644 --- a/releaser.yaml +++ b/releaser.yaml @@ -3,11 +3,11 @@ flavors: - name: upstream - # renovate: datasource=docker depName=nginx versioning=semver-coerced - version: 1.27.3 + # renovate-uds: datasource=docker depName=nginx + version: 1.27.3-uds.0 - name: registry1 - # renovate: datasource=docker depName=registry1.dso.mil/ironbank/opensource/nginx/nginx versioning=semver-coerced - version: 1.27.3 + # renovate-uds: datasource=docker depName=registry1.dso.mil/ironbank/opensource/nginx/nginx + version: 1.27.3-uds.0 - name: unicorn - # renovate: datasource=docker depName=cgr.dev/du-uds-defenseunicorns/nginx versioning=semver-coerced - version: 1.27.3 + # renovate-uds: datasource=docker depName=cgr.dev/du-uds-defenseunicorns/nginx + version: 1.27.3-uds.0 diff --git a/tasks.yaml b/tasks.yaml index ac82dfac..ac4ca92a 100644 --- a/tasks.yaml +++ b/tasks.yaml @@ -149,5 +149,3 @@ tasks: - description: Publish the packages task: publish:package - with: - version: ${VERSION} diff --git a/tasks/publish.yaml b/tasks/publish.yaml index 7dec312a..85e7d604 100644 --- a/tasks/publish.yaml +++ b/tasks/publish.yaml @@ -21,7 +21,7 @@ tasks: default: . version: description: The version of the package to publish - required: true + default: ${VERSION} architecture: description: The architecture of the package to publish default: ${UDS_ARCH} diff --git a/tasks/upgrade.yaml b/tasks/upgrade.yaml index 320b8076..bcccbc25 100644 --- a/tasks/upgrade.yaml +++ b/tasks/upgrade.yaml @@ -72,6 +72,7 @@ tasks: # VARIABLES PACKAGE_NAME=$(cat ${{ .inputs.path }}/zarf.yaml | ./uds zarf tools yq .metadata.name) + LOCAL_VERSION=$(cat ${{ .inputs.path }}/zarf.yaml | ./uds zarf tools yq .metadata.version) LATEST_VERSION=$(./uds zarf tools registry ls "${TARGET_REPO}/${PACKAGE_NAME}" | grep "${FLAVOR}" | sort -V | tail -1) BUNDLE_NAME=$(cat ${{ .inputs.bundle_path }}/uds-bundle.yaml | ./uds zarf tools yq .metadata.name) PREVIOUS_BUNDLE_VERSION=$(cat ${{ .inputs.bundle_path }}/uds-bundle.yaml | ./uds zarf tools yq .metadata.version) @@ -82,6 +83,8 @@ tasks: --no-progress \ -o ${{ .inputs.path }} + mv "${{ .inputs.path }}/zarf-package-${PACKAGE_NAME}-${{ .inputs.architecture }}-${LATEST_VERSION%-*}.tar.zst" "${{ .inputs.path }}/zarf-package-${PACKAGE_NAME}-${{ .inputs.architecture }}-${LOCAL_VERSION}.tar.zst" + # Run any dependency commands (i.e. uds run dependencies:create) sh -c "${{ .inputs.dep_commands }}" From 5906378f1fad07bba927dc953c4bf42602e1b6da Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:27:25 -0700 Subject: [PATCH 2/2] chore(main): release 1.5.1 (#360) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Wayne Starr --- .github/workflows/ci-docs-shim.yaml | 2 ++ .release-please-manifest.json | 2 +- CHANGELOG.md | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-docs-shim.yaml b/.github/workflows/ci-docs-shim.yaml index eabd7f22..9b1ea7fc 100644 --- a/.github/workflows/ci-docs-shim.yaml +++ b/.github/workflows/ci-docs-shim.yaml @@ -5,6 +5,8 @@ name: CI Doc Shim on: pull_request: + # milestoned is added here as a workaround for release-please not triggering PR workflows (PRs should be added to a milestone to trigger the workflow). + types: [milestoned, opened, reopened, synchronize] paths: - "**.md" - "**.jpg" diff --git a/.release-please-manifest.json b/.release-please-manifest.json index dd8fde77..e20d7e81 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.5.0" + ".": "1.5.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index bc0d43dc..46f186b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.5.1](https://github.com/defenseunicorns/uds-common/compare/v1.5.0...v1.5.1) (2024-12-09) + + +### Miscellaneous + +* add a renovate rule for handling uds versions from upstream ones ([#359](https://github.com/defenseunicorns/uds-common/issues/359)) ([34dfed1](https://github.com/defenseunicorns/uds-common/commit/34dfed162e220d6cdbb13b8910a78ff3d00d1f08)) + ## [1.5.0](https://github.com/defenseunicorns/uds-common/compare/v1.4.0...v1.5.0) (2024-12-06)