From f95aed98383c300cac3e2b4502e27423619b59b6 Mon Sep 17 00:00:00 2001 From: Nic Cope Date: Wed, 1 Nov 2023 16:10:07 -0700 Subject: [PATCH] Use Go style pseudo-versions when there is no semver supplied details. See https://github.com/crossplane/function-template-go/pull/38. Signed-off-by: Nic Cope --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b18fbc8..569a583 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,10 +152,12 @@ jobs: password: ${{ secrets.XPKG_TOKEN }} # If a version wasn't explicitly passed as a workflow_dispatch input we - # default to version v0.0.0-shortsha, for example v0.0.0-8ed5691. + # default to version v0.0.0--, for example + # v0.0.0-20231101115142-1091066df799. This is a simple implementation of + # Go's pseudo-versions: https://go.dev/ref/mod#pseudo-versions. - name: Set Default Multi-Platform Package Version if: env.XPKG_VERSION == '' - run: echo "XPKG_VERSION=v0.0.0-$(git rev-parse --short HEAD)" >> $GITHUB_ENV + run: echo "XPKG_VERSION=v0.0.0-$(date -d@$(git show -s --format=%ct) +%Y%m%d%H%M%S)-$(git rev-parse --short=12 HEAD)" >> $GITHUB_ENV - name: Push Multi-Platform Package to Upbound if: env.XPKG_ACCESS_ID != ''