Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,30 @@
],
},
packageRules: [
{
// Normal Go module updates wait 3 days after release, so a compromised
// version is more likely to be caught upstream before Renovate proposes
// it. Security fixes are not delayed (vulnerabilityAlerts sets no
// minimumReleaseAge). Scoped to Go modules: the Go proxy publishes
// release dates, and updates without one would be held back forever.
matchDatasources: [
'go',
],
minimumReleaseAge: '3 days',
},
{
// Pin Dockerfile images by digest (base image, dockerfile syntax), so a
// build always uses the exact image Renovate proposed; digest updates come
// as PRs. Not golang: CI sets its tag from go.mod's toolchain, the ARG
// default only matters for local builds. Not example/ package refs.
matchManagers: [
'dockerfile',
],
matchPackageNames: [
'!golang',
],
pinDigests: true,
},
{
matchManagers: [
'crossplane',
Expand Down
33 changes: 27 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,20 @@ on:
description: Package version (e.g. v0.1.0)
required: false

# Least privilege for GITHUB_TOKEN: nothing here writes to the repository
# (packages are pushed with the Upbound robot credentials).
permissions:
contents: read

env:
# Common versions. Go comes from each repo's go.mod (toolchain directive).
GOLANGCI_VERSION: 'v2.11.4'
DOCKER_BUILDX_VERSION: 'v0.23.0'

# These environment variables are important to the Crossplane CLI install.sh
# script. They determine what version it installs.
XP_CHANNEL: master # TODO(negz): Pin to stable once v1.14 is released.
XP_VERSION: current # TODO(negz): Pin to a version once v1.14 is released.
# Crossplane CLI used to build and push the package: a pinned stable release
# (Renovate in upbound/sa-up bumps XP_VERSION).
XP_CHANNEL: stable
XP_VERSION: v2.5.0

# This CI job will automatically push new builds to xpkg.upbound.io if the
# XPKG_ACCESS_ID and XPKG_TOKEN secrets are set in the GitHub respository (or
Expand Down Expand Up @@ -125,8 +130,16 @@ jobs:
GO_VERSION=${{ env.GO_VERSION }}
outputs: type=docker,dest=runtime-${{ matrix.arch }}.tar

# Pinned release, verified against the checksum published next to it
# (XP_VERSION is bumped by Renovate in upbound/sa-up). The runner is
# linux/amd64; matrix.arch is only the package's target platform.
- name: Setup the Crossplane CLI
run: "curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh"
run: |
base="https://cli.crossplane.io/${XP_CHANNEL}/${XP_VERSION}/bin/linux_amd64"
curl -sSfL "${base}/crossplane" -o crossplane
echo "$(curl -sSfL "${base}/crossplane.sha256" | cut -d' ' -f1) crossplane" | sha256sum -c -
chmod +x crossplane
./crossplane version --client

- name: Build Package
run: ./crossplane xpkg build --package-file=${{ matrix.arch }}.xpkg --package-root=package/ --embed-runtime-image-tarball=runtime-${{ matrix.arch }}.tar
Expand Down Expand Up @@ -157,8 +170,16 @@ jobs:
merge-multiple: true
pattern: "!*.dockerbuild" # This gets uploaded by docker/build-push-action but must be skipped: https://github.com/actions/toolkit/pull/1874

# Pinned release, verified against the checksum published next to it
# (XP_VERSION is bumped by Renovate in upbound/sa-up). The runner is
# linux/amd64; matrix.arch is only the package's target platform.
- name: Setup the Crossplane CLI
run: "curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh"
run: |
base="https://cli.crossplane.io/${XP_CHANNEL}/${XP_VERSION}/bin/linux_amd64"
curl -sSfL "${base}/crossplane" -o crossplane
echo "$(curl -sSfL "${base}/crossplane.sha256" | cut -d' ' -f1) crossplane" | sha256sum -c -
chmod +x crossplane
./crossplane version --client

- name: Login to Upbound
uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ concurrency:
cancel-in-progress: true

env:
# Pinned CLI versions (Renovate in upbound/sa-up bumps them).
UP_VERSION: v0.56.0
XP_CHANNEL: stable
XP_VERSION: v2.5.0
UP_API_TOKEN: ${{ secrets.UP_E2E_API_TOKEN }}
UP_ORG: ${{ secrets.UP_E2E_ORG }}
UP_GROUP: ${{ secrets.UP_E2E_GROUP }}
Expand Down Expand Up @@ -119,6 +123,7 @@ jobs:
if: steps.harness.outputs.present == 'true'
uses: upbound/action-up@53fe6395637d884c80d2bbc8c2d75d0ece776ced # v1
with:
version: ${{ env.UP_VERSION }}
api-token: ${{ env.UP_API_TOKEN }}
organization: ${{ env.UP_ORG }}

Expand Down Expand Up @@ -147,9 +152,17 @@ jobs:
GO_VERSION=${{ env.GO_VERSION }}
outputs: type=docker,dest=runtime-amd64.tar

# Pinned release, verified against the checksum published next to it
# (XP_VERSION is bumped by Renovate in upbound/sa-up). The runner is
# linux/amd64; matrix.arch is only the package's target platform.
- name: Setup the Crossplane CLI
if: steps.harness.outputs.present == 'true'
run: curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh
run: |
base="https://cli.crossplane.io/${XP_CHANNEL}/${XP_VERSION}/bin/linux_amd64"
curl -sSfL "${base}/crossplane" -o crossplane
echo "$(curl -sSfL "${base}/crossplane.sha256" | cut -d' ' -f1) crossplane" | sha256sum -c -
chmod +x crossplane
./crossplane version --client

- name: Build and push the function dev package
if: steps.harness.outputs.present == 'true'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
description: 'Tag message'
required: true

# Least privilege for GITHUB_TOKEN: creating the tag is the only write.
permissions:
contents: write

jobs:
create-tag:
runs-on: ubuntu-latest
Expand Down
Loading