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
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,18 @@ jobs:
username: ${{ secrets.UP_ROBOT_ID }}
password: ${{ secrets.UP_ROBOT_TOKEN }}

# On a release run, fetch the GitHub release's notes so the push app
# embeds them in the package's Marketplace extensions. Ordinary runs
# skip this; the push app only appends the notes when the file exists.
- name: Generate release notes
if: inputs.tag != ''
env:
GH_TOKEN: ${{ github.token }}

@haarchri haarchri Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to check that this GH_TOKEN is available

TAG: ${{ inputs.tag }}
run: |
gh release view "${TAG}" --json body -q .body > release_notes.md || true
[ -s release_notes.md ] || rm -f release_notes.md

# With a tag input (a release) push that exact version; otherwise push a
# dev version the push app derives from git metadata.
- name: Build and Push
Expand Down
18 changes: 18 additions & 0 deletions extensions/icons/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
};
push = apps.push {
inherit crossplane version;
dockerCredentialUp = pkgs.upbound;
inherit (pkgs) upbound;
};
run = apps.run {
inherit crossplane functionsPkg;
Expand Down
39 changes: 35 additions & 4 deletions nix/apps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,18 @@
);
};

# Push the Crossplane project to a registry. Uses a dev version tag unless
# --tag is passed, e.g.: nix run .#push -- --tag v0.1.0
# Push the Crossplane project to a registry, then append the package's
# Upbound Marketplace extensions to the pushed image. Uses a dev version tag
# unless --tag is passed, e.g.: nix run .#push -- --tag v0.1.0
#
# The Marketplace renders package assets from a well-known extensions image
# layout: icons/ (committed under extensions/), readme/readme.md (copied
# from README.md), and release-notes/ (included when a release_notes.md
# exists in the working directory - CI writes it on release runs).
push =
{
crossplane,
dockerCredentialUp,
upbound,
version,
}:
{
Expand All @@ -166,9 +172,14 @@
program = pkgs.lib.getExe (
pkgs.writeShellApplication {
name = "modelplane-push";
# upbound provides both docker-credential-up, which the Crossplane
# CLI uses to authenticate the push, and up, which appends the
# extensions.
runtimeInputs = [
crossplane
dockerCredentialUp
upbound
pkgs.coreutils
pkgs.yq-go
];
inheritPath = false;
text = ''
Expand All @@ -177,6 +188,26 @@
set -- --tag "${version}" "$@"
fi
crossplane project push "$@"

tag=""
while [ $# -gt 1 ]; do
if [ "$1" = "--tag" ]; then tag="$2"; fi
shift
done
repository=$(yq '.spec.repository' crossplane-project.yaml)

extensions=$(mktemp -d)
trap 'rm -rf "$extensions"' EXIT
cp -R extensions/. "$extensions/"
mkdir -p "$extensions/readme"
cp README.md "$extensions/readme/readme.md"
if [ -f release_notes.md ]; then
mkdir -p "$extensions/release-notes"
cp release_notes.md "$extensions/release-notes/"
fi

echo "Appending Marketplace extensions to $repository:$tag"
up alpha xpkg append "$repository:$tag" --extensions-root "$extensions"
'';
}
);
Expand Down
5 changes: 4 additions & 1 deletion nix/functions.nix
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ let
let
targetSystem = archToNixSystem.${arch};
targetPkgs =
if targetSystem == pkgs.system then pkgs else import pkgs.path { system = targetSystem; };
if targetSystem == pkgs.stdenv.hostPlatform.system then
pkgs
else
import pkgs.path { system = targetSystem; };
in
{
inherit targetPkgs;
Expand Down
Loading