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
66 changes: 62 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ name: CI
on:
push:
branches:
- main
- mima
- release-*
- mima-release-*
tags:
- 'v*'
pull_request: {}
workflow_dispatch:
inputs:
Expand All @@ -23,7 +26,7 @@ env:

# 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_CHANNEL: stable # TODO(negz): Pin to stable once v1.14 is released.
XP_VERSION: current # TODO(negz): Pin to a version once v1.14 is released.

# This CI job will automatically push new builds to xpkg.upbound.io if the
Expand Down Expand Up @@ -159,7 +162,7 @@ jobs:
# XPKG_ACCESS_ID and XPKG_TOKEN secrets were provided.
push:
permissions:
contents: read
contents: write
packages: write # for pushing to ghcr.io
if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-24.04
Expand All @@ -186,6 +189,13 @@ jobs:
registry: xpkg.upbound.io
username: ${{ secrets.XPKG_ACCESS_ID }}
password: ${{ secrets.XPKG_TOKEN }}

# On a v* tag push (created by crossplane-gitops/release-fork.yml at the
# head of a mima-release-* branch) the package is versioned after the tag.
# release-fork.yml then validates the signature of that exact package.
- name: Use Tag as Multi-Platform Package Version
if: env.XPKG_VERSION == '' && startsWith(github.ref, 'refs/tags/v')
run: echo "XPKG_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV

# If a version wasn't explicitly passed as a workflow_dispatch input we
# default to version v0.0.0-<git-commit-date>-<git-short-sha>, for example
Expand All @@ -200,12 +210,60 @@ jobs:
run: "./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:${{ env.XPKG_VERSION }}"

- name: Login to GHCR
if: startsWith(github.ref, 'refs/heads/mima-release-') || startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@06fb636fac595d6fb4b28a5dfcb21a6f5091859c # v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push Multi-Platform Package to GHCR
if: env.XPKG_ACCESS_ID != ''
if: startsWith(github.ref, 'refs/heads/mima-release-') || startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/tags/')
run: "./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.CROSSPLANE_REGORG }}:${{ env.XPKG_VERSION }}"
- name: Install Cosign
if: startsWith(github.ref, 'refs/heads/mima-release-') || startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/tags/')
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3
- name: Sign OCI Package
if: startsWith(github.ref, 'refs/heads/mima-release-') || startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/tags/')
env:
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_SIGNING_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
run: |
cosign sign \
--key env://COSIGN_PRIVATE_KEY \
--tlog-upload=false \
--yes \
${{ env.CROSSPLANE_REGORG }}:${{ env.XPKG_VERSION }}
- name: Publish GitHub Release with cosign.pub
if: startsWith(github.ref, 'refs/tags/')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
if gh release view ${{ github.ref_name }} --repo ${{ github.repository }} >/dev/null 2>&1; then
gh release upload ${{ github.ref_name }} release/cosign.pub \
--repo ${{ github.repository }} --clobber
else
gh release create ${{ github.ref_name }} release/cosign.pub \
--repo ${{ github.repository }} \
--title ${{ github.ref_name }} \
--notes "mimacom signed release ${{ github.ref_name }}."
fi
codeql:
runs-on: ubuntu-24.04
permissions:
contents: read
security-events: write
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6

- name: Initialize CodeQL
uses: github/codeql-action/init@e46ed2cbd01164d986452f91f178727624ae40d7 # v4
with:
languages: go

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@e46ed2cbd01164d986452f91f178727624ae40d7 # v4


21 changes: 21 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Security Policy

## Supported Versions

Use this section to tell people about which versions of your project are
currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 5.1.x | :white_check_mark: |
| 5.0.x | :x: |
| 4.0.x | :white_check_mark: |
| < 4.0 | :x: |

## Reporting a Vulnerability

Use this section to tell people how to report a vulnerability.

Tell them where to go, how often they can expect to get an update on a
reported vulnerability, what to expect if the vulnerability is accepted or
declined, etc.
4 changes: 4 additions & 0 deletions release/cosign.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE+2595hYxY0xnVpQPCuKQube8LoCv
M2KCpe5WmuuGxxNkvmNuoF7+sTUACm3Qs7l+hT39abobuTUs2w2EV6PjyA==
-----END PUBLIC KEY-----
Loading