From 071c1245277b93f88cae56bf5866dc2cc8a1c1b3 Mon Sep 17 00:00:00 2001 From: Steven Borrelli Date: Mon, 7 Oct 2024 21:59:51 +0200 Subject: [PATCH 1/3] update repo location Signed-off-by: Steven Borrelli --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index faeb332..b9e9d9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,8 +30,7 @@ env: # The package to push, without a version tag. The default matches GitHub. For # example xpkg.upbound.io/crossplane/function-template-go. - # XPKG: xpkg.upbound.io/${{ github.repository}} - XPKG: xpkg.upbound.io/borrelli-org/function-tag-manager + XPKG: xpkg.upbound.io/${{ github.repository}} # The package version to push. The default is 0.0.0-gitsha. XPKG_VERSION: ${{ inputs.version }} From 5614345f99f45bf54765d225d1ba8bac7a19efeb Mon Sep 17 00:00:00 2001 From: Steven Borrelli Date: Mon, 7 Oct 2024 22:17:42 +0200 Subject: [PATCH 2/3] update ci workflow Signed-off-by: Steven Borrelli --- .github/workflows/ci.yml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9e9d9c..4bce67e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,8 +14,8 @@ on: env: # Common versions - GO_VERSION: '1.23.1' - GOLANGCI_VERSION: 'v1.61.0' + GO_VERSION: '1.21.3' + GOLANGCI_VERSION: 'v1.54.2' DOCKER_BUILDX_VERSION: 'v0.11.2' # These environment variables are important to the Crossplane CLI install.sh @@ -37,7 +37,7 @@ env: jobs: lint: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -48,13 +48,16 @@ jobs: go-version: ${{ env.GO_VERSION }} cache: false # The golangci-lint action does its own caching. + - name: Check go mod tidy + run: go mod tidy && git diff --exit-code go.mod go.sum + - name: Lint uses: golangci/golangci-lint-action@v6 with: version: ${{ env.GOLANGCI_VERSION }} unit-test: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -70,9 +73,9 @@ jobs: # We want to build most packages for the amd64 and arm64 architectures. To # speed this up we build single-platform packages in parallel. We then upload # those packages to GitHub as a build artifact. The push job downloads those - # artifacts and pushes them as a single multi-platform package. + # artifacts and pushes them as a single multi-platform package. build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: fail-fast: true matrix: @@ -98,7 +101,7 @@ jobs: # the build, per https://docs.docker.com/build/cache/backends/gha/. - name: Build Runtime id: image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . platforms: linux/${{ matrix.arch }} @@ -108,17 +111,17 @@ jobs: build-args: GO_VERSION=${{ env.GO_VERSION }} outputs: type=docker,dest=runtime-${{ matrix.arch }}.tar - + - name: Setup the Crossplane CLI run: "curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh" - name: Build Package run: ./crossplane xpkg build --package-file=${{ matrix.arch }}.xpkg --package-root=package/ --embed-runtime-image-tarball=runtime-${{ matrix.arch }}.tar - + - name: Upload Single-Platform Package uses: actions/upload-artifact@v4 with: - name: packages + name: package-${{ matrix.arch }} path: "*.xpkg" if-no-files-found: error retention-days: 1 @@ -127,7 +130,7 @@ jobs: # pushes them as a multi-platform package. We only push the package it the # XPKG_ACCESS_ID and XPKG_TOKEN secrets were provided. push: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 needs: - build steps: @@ -137,13 +140,13 @@ jobs: - name: Download Single-Platform Packages uses: actions/download-artifact@v4 with: - name: packages path: . + merge-multiple: true - name: Setup the Crossplane CLI run: "curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh" - - name: Login to Dockerhub + - name: Login to Upbound uses: docker/login-action@v3 if: env.XPKG_ACCESS_ID != '' with: From edb34451d0111521d638f092a4322539cbf3cda0 Mon Sep 17 00:00:00 2001 From: Steven Borrelli Date: Mon, 7 Oct 2024 22:32:21 +0200 Subject: [PATCH 3/3] update go version Signed-off-by: Steven Borrelli --- .github/workflows/ci.yml | 4 ++-- README.md | 8 ++++---- examples/configuration-aws-network/composition.yaml | 2 +- examples/configuration-aws-network/functions.yaml | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4bce67e..12f5a1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,8 +14,8 @@ on: env: # Common versions - GO_VERSION: '1.21.3' - GOLANGCI_VERSION: 'v1.54.2' + GO_VERSION: '1.23.1' + GOLANGCI_VERSION: 'v1.55.2' DOCKER_BUILDX_VERSION: 'v0.11.2' # These environment variables are important to the Crossplane CLI install.sh diff --git a/README.md b/README.md index afa09c2..5a9fc66 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,9 @@ will move to crossplane-contrib once initial testing is successful. apiVersion: pkg.crossplane.io/v1beta1 kind: Function metadata: - name: borrelli-org-function-tag-manager + name: crossplane-contrib-function-tag-manager spec: - package: xpkg.upbound.io/borrelli-org/function-tag-manager:v0.2.0 + package: xpkg.upbound.io/crossplane-contrib/function-tag-manager:v0.3.0 ``` ## Using this Function in a Composition @@ -34,7 +34,7 @@ created Desired State. Below is an example pipeline step: ```yaml - step: manage-tags functionRef: - name: borrelli-org-function-tag-manager + name: crossplane-contrib-function-tag-manager input: apiVersion: tag-manger.fn.crossplane.io/v1beta1 kind: ManagedTags @@ -219,5 +219,5 @@ crossplane xpkg build -f package --embed-runtime-image=function-tag-manager -o f I use the `up` binary to push to the [Upbound Marketplace](https://marketplace.upbound.io) ```shell -up xpkg push xpkg.upbound.io/borrelli-org/function-tag-manager:v0.1.0 -f function-tag-manager.xpkg +up xpkg push xpkg.upbound.io/crossplane-contrib/function-tag-manager:v0.1.0 -f function-tag-manager.xpkg ``` diff --git a/examples/configuration-aws-network/composition.yaml b/examples/configuration-aws-network/composition.yaml index fb0517c..1ac41ce 100644 --- a/examples/configuration-aws-network/composition.yaml +++ b/examples/configuration-aws-network/composition.yaml @@ -318,7 +318,7 @@ spec: {{- end }} - step: manage-tags functionRef: - name: borrelli-org-function-tag-manager + name: crossplane-contrib-function-tag-manager input: apiVersion: tag-manger.fn.crossplane.io/v1beta1 kind: ManagedTags diff --git a/examples/configuration-aws-network/functions.yaml b/examples/configuration-aws-network/functions.yaml index f0b8ed4..44b2230 100644 --- a/examples/configuration-aws-network/functions.yaml +++ b/examples/configuration-aws-network/functions.yaml @@ -16,10 +16,10 @@ spec: apiVersion: pkg.crossplane.io/v1beta1 kind: Function metadata: - name: borrelli-org-function-tag-manager + name: crossplane-contrib-function-tag-manager # Comment out for local development - # annotations: - # render.crossplane.io/runtime: Development + annotations: + render.crossplane.io/runtime: Development spec: - package: xpkg.upbound.io/borrelli-org/function-tag-manager:v0.2.0 + package: xpkg.upbound.io/crossplane-contrib/function-tag-manager:v0.3.0