Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: test artifacts before publish #198

Merged
merged 13 commits into from
Mar 12, 2024
Merged
26 changes: 20 additions & 6 deletions .github/workflows/tag-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ jobs:
strategy:
matrix:
flavor: [upstream, registry1]
type: [standard, istio]
needs: tag-new-version
if: ${{ needs.tag-new-version.outputs.release_created == 'true'}}
runs-on: ubuntu-latest
runs-on: "uds-ubuntu-big-boy-8-core"
name: Publish packages

permissions:
Expand All @@ -46,12 +47,25 @@ jobs:
- name: Login to registry1
run: uds run registry-login --set REGISTRY=registry1.dso.mil --set REGISTRY_USERNAME=${{ secrets.IRON_BANK_ROBOT_USERNAME }} --set REGISTRY_PASSWORD=${{ secrets.IRON_BANK_ROBOT_PASSWORD }} --set REGISTRY_RETRY_INTERVAL=90

- name: Publish UDS Zarf Package
run: uds run -f tasks/publish.yaml packages --set FLAVOR=${{ matrix.flavor }}
- name: Create Packages and Bundles
run: |
ZARF_ARCHITECTURE=amd64 uds run -f tasks/create.yaml ${{ matrix.type}}-package --no-progress --set FLAVOR=${{ matrix.flavor }}
ZARF_ARCHITECTURE=amd64 uds run -f tasks/create.yaml k3d-${{ matrix.type }}-bundle --no-progress

ZARF_ARCHITECTURE=arm64 uds run -f tasks/create.yaml ${{ matrix.type}}-package --no-progress --set FLAVOR=${{ matrix.flavor }}
ZARF_ARCHITECTURE=arm64 uds run -f tasks/create.yaml k3d-${{ matrix.type }}-bundle --no-progress

- name: Deploy amd64 Bundles
run: uds run -f tasks/deploy.yaml k3d-${{ matrix.type }}-bundle --no-pogress --set uds_arch=amd64
TristanHoladay marked this conversation as resolved.
Show resolved Hide resolved

- name: Publish Standard Package
if: ${{ matrix.type == 'standard' }}
run: uds run -f tasks/publish.yaml ${{ matrix.type }}-package --set FLAVOR=${{ matrix.flavor }}


- name: Publish UDS Bundles
if: ${{ matrix.flavor != 'registry1' }}
run: uds run -f tasks/publish.yaml bundles
- name: Publish Upstream Flavored Bundles
if: ${{ matrix.flavor != 'registry1'}}
run: uds run -f tasks/publish.yaml bundles --set TYPE=${{ matrix.type }}

- name: Save logs
if: always()
Expand Down
50 changes: 13 additions & 37 deletions tasks/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,60 +5,36 @@ variables:
- name: FLAVOR
default: upstream

- name: TYPE

- name: VERSION
description: "The version of the packages to build"
# x-release-please-start-version
default: "0.15.0"
# x-release-please-end

tasks:
- name: packages
- name: standard-package
description: "Build and publish the UDS packages"
TristanHoladay marked this conversation as resolved.
Show resolved Hide resolved
actions:
- description: "Create the UDS Core Standard Zarf Package"
cmd: |
ZARF_ARCHITECTURE=amd64 uds run -f tasks/create.yaml standard-package --no-progress --set FLAVOR=${FLAVOR}
if [ "${FLAVOR}" != "registry1" ]; then
ZARF_ARCHITECTURE=arm64 uds run -f tasks/create.yaml standard-package --no-progress --set FLAVOR=${FLAVOR}
fi

- description: "Create the UDS Core Istio Only Zarf Package"
cmd: |
ZARF_ARCHITECTURE=amd64 uds run -f tasks/create.yaml istio-package --no-progress --set FLAVOR=${FLAVOR}
if [ "${FLAVOR}" != "registry1" ]; then
ZARF_ARCHITECTURE=arm64 uds run -f tasks/create.yaml istio-package --no-progress --set FLAVOR=${FLAVOR}
fi

- description: "Publish the packages"
cmd: |
uds zarf package publish build/zarf-package-core-amd64-${VERSION}.tar.zst ${TARGET_REPO}

# dont publish arm64 for registry1 since IB images are only amd64
ZARF_ARCHITECTURE=amd64 uds run -f tasks/create.yaml standard-package --no-progress --set FLAVOR=${FLAVOR}
if [ "${FLAVOR}" != "registry1" ]; then
uds zarf package publish build/zarf-package-core-arm64-${VERSION}.tar.zst ${TARGET_REPO}
ZARF_ARCHITECTURE=arm64 uds run -f tasks/create.yaml standard-package --no-progress --set FLAVOR=${FLAVOR}
fi
TristanHoladay marked this conversation as resolved.
Show resolved Hide resolved

- name: bundles
description: "Build and publish UDS bundles"
description: "Publish UDS Bundles"
actions:
- description: "Create the UDS Core Standard Bundle"
cmd: |
ZARF_ARCHITECTURE=amd64 uds run -f tasks/create.yaml k3d-standard-bundle --no-progress
ZARF_ARCHITECTURE=arm64 uds run -f tasks/create.yaml k3d-standard-bundle --no-progress

- description: Create the UDS Core Istio Only Bundle
cmd: |
ZARF_ARCHITECTURE=amd64 uds run -f tasks/create.yaml k3d-istio-bundle --no-progress
ZARF_ARCHITECTURE=arm64 uds run -f tasks/create.yaml k3d-istio-bundle --no-progress

- description: "Publish the bundles"
- description: "Publish amd64 and arm64 bundles"
cmd: |
uds publish bundles/k3d-standard/uds-bundle-k3d-core-demo-arm64-${VERSION}.tar.zst ${TARGET_REPO}/bundles --no-progress
uds publish bundles/k3d-istio/uds-bundle-k3d-core-istio-dev-arm64-${VERSION}.tar.zst ${TARGET_REPO}/bundles --no-progress
uds publish bundles/k3d-standard/uds-bundle-k3d-core-demo-amd64-${VERSION}.tar.zst ${TARGET_REPO}/bundles --no-progress
uds publish bundles/k3d-istio/uds-bundle-k3d-core-istio-dev-amd64-${VERSION}.tar.zst ${TARGET_REPO}/bundles --no-progress
uds publish bundles/k3d-${TYPE}/uds-bundle-k3d-*-amd64-${VERSION}.tar.zst ${TARGET_REPO}/bundles --no-progress
uds publish bundles/k3d-${TYPE}/uds-bundle-k3d-*-arm64-${VERSION}.tar.zst ${TARGET_REPO}/bundles --no-progress

- description: "Tag the latest bundles"
cmd: |
pkgPath="ghcr.io/defenseunicorns/packages/uds/bundles/k3d-core-demo"
uds zarf tools registry copy ${pkgPath}:${VERSION} ${pkgPath}:latest
if [ "${TYPE}" == "standard" ]; then
pkgPath="ghcr.io/defenseunicorns/packages/uds/bundles/k3d-core-demo"
uds zarf tools registry copy ${pkgPath}:${VERSION} ${pkgPath}:latest
fi