Skip to content

Commit

Permalink
Merge pull request #6 from crossplane-contrib/ci-update
Browse files Browse the repository at this point in the history
Update package repo location
  • Loading branch information
stevendborrelli authored Oct 7, 2024
2 parents 0600602 + edb3445 commit d3be9be
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
env:
# Common versions
GO_VERSION: '1.23.1'
GOLANGCI_VERSION: 'v1.61.0'
GOLANGCI_VERSION: 'v1.55.2'
DOCKER_BUILDX_VERSION: 'v0.11.2'

# These environment variables are important to the Crossplane CLI install.sh
Expand All @@ -30,15 +30,14 @@ 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 }}

jobs:
lint:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -49,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
Expand All @@ -71,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:
Expand All @@ -99,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 }}
Expand All @@ -109,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
Expand All @@ -128,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:
Expand All @@ -138,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:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
```
2 changes: 1 addition & 1 deletion examples/configuration-aws-network/composition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions examples/configuration-aws-network/functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d3be9be

Please sign in to comment.