/ tasks / publish.yaml
publish.yaml
 1  # Copyright 2024 Defense Unicorns
 2  # SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial
 3  
 4  includes:
 5    - utils: utils.yaml
 6    - test: test.yaml
 7    - create: create.yaml
 8    - deploy: deploy.yaml
 9    - setup: setup.yaml
10  
11  variables:
12    - name: FLAVOR
13      default: upstream
14  
15    - name: VERSION
16      description: "The version of the packages to build"
17      # x-release-please-start-version
18      default: "0.59.0"
19      # x-release-please-end
20  
21    - name: LAYER
22  
23  tasks:
24    - name: standard-package
25      description: "Publish the UDS package"
26      actions:
27        - task: utils:determine-repo
28        - description: "Publish amd64/arm64 packages per flavor"
29          cmd: |
30            echo "Publishing package to ${TARGET_REPO}"
31            uds zarf package publish build/zarf-package-core-amd64-${VERSION}.tar.zst oci://${TARGET_REPO}
32            uds zarf package publish build/zarf-package-core-arm64-${VERSION}.tar.zst oci://${TARGET_REPO}
33  
34        - description: "Tag the latest package (if a snapshot release)"
35          cmd: |
36            if [ $(echo "${TARGET_REPO}" | grep 'snapshot') ]; then
37               pkgPath="${TARGET_REPO}/core"
38               uds zarf tools registry copy ${pkgPath}:${VERSION}-${FLAVOR} ${pkgPath}:latest-${FLAVOR}
39            fi
40  
41    - name: checkpoint-package
42      description: "Publish the UDS checkpoint package"
43      actions:
44        - description: "Publish the checkpoint package for the current UDS_ARCH"
45          cmd: |
46            uds zarf package publish build/zarf-package-k3d-core-slim-dev-${UDS_ARCH}-${VERSION}.tar.zst oci://ghcr.io/defenseunicorns/dev/uds/checkpoints
47  
48    - name: bundles
49      description: "Publish UDS Bundles"
50      actions:
51        - task: utils:determine-repo
52        - description: "Publish amd64 and arm64 bundles"
53          cmd: |
54            echo "Publishing bundles to ${TARGET_REPO}"
55            uds publish bundles/k3d-standard/uds-bundle-k3d-*-amd64-${VERSION}.tar.zst oci://${TARGET_REPO}/bundles --no-progress
56            uds publish bundles/k3d-standard/uds-bundle-k3d-*-arm64-${VERSION}.tar.zst oci://${TARGET_REPO}/bundles --no-progress
57  
58            uds publish bundles/k3d-slim-dev/uds-bundle-k3d-*-arm64-${VERSION}.tar.zst oci://${TARGET_REPO}/bundles --no-progress
59            uds publish bundles/k3d-slim-dev/uds-bundle-k3d-*-amd64-${VERSION}.tar.zst oci://${TARGET_REPO}/bundles --no-progress
60  
61        - description: "Tag the latest bundles"
62          cmd: |
63            pkgPath="${TARGET_REPO}/bundles/k3d-core-demo"
64            uds zarf tools registry copy ${pkgPath}:${VERSION} ${pkgPath}:latest
65            pkgPath="${TARGET_REPO}/bundles/k3d-core-slim-dev"
66            uds zarf tools registry copy ${pkgPath}:${VERSION} ${pkgPath}:latest
67  
68    - name: single-layer
69      description: "Test and Publish UDS Core layer"
70      actions:
71        - task: test:layer-dependencies
72        - task: create:single-layer
73          with:
74            layer: ${LAYER}
75        - task: deploy:single-layer
76          with:
77            layer: ${LAYER}
78        - task: test:validate-package
79          with:
80            layer: ${LAYER}
81        - task: utils:determine-repo
82        - description: "Publish build of layer"
83          cmd: uds zarf package publish build/zarf-package-core-${LAYER}-${UDS_ARCH}-${VERSION}.tar.zst oci://${TARGET_REPO}