Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

ci: update logic to pull velero version for workflow testing (#755) #337

ci: update logic to pull velero version for workflow testing (#755)

ci: update logic to pull velero version for workflow testing (#755) #337

name: Publish DUBBD
on:
push:
branches:
- main
jobs:
tag-new-version:
permissions: write-all
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release-flag.outputs.release_created }}
release_tag: ${{ steps.release-tag.outputs.release_tag }}
steps:
- name: Create Release Tag
id: tag
uses: googleapis/release-please-action@v4
- id: release-flag
run: echo "release_created=${{ steps.tag.outputs.release_created || false }}" >> $GITHUB_OUTPUT
- id: release-tag
run: echo "release_tag=${{ steps.tag.outputs.version || false }}" >> $GITHUB_OUTPUT
build-release-notes-update:
needs: tag-new-version
if: ${{ needs.tag-new-version.outputs.release_created == 'true'}}
runs-on: ubuntu-latest
outputs:
header_info: ${{ steps.header-info.outputs.header_info }}
deploy_info: ${{ steps.deploy-info.outputs.deploy_info }}
steps:
- name: Build Header Info
id: header-info
run: |
# set header to markdown comment
HEADER_INFO='[//]: # (MODIFIED BY WORKFLOW)'
# set GH output
echo "header_info=${HEADER_INFO}" >> $GITHUB_OUTPUT
- name: Build Deploy Info
id: deploy-info
run: |
PREFIX='---\n#### HOW TO DEPLOY\n'
# set list of all zarf pkgs
PKGS="dubbd \
dubbd-aws \
dubbd-rke2 \
dubbd-k3d"
# loop thru all the zarf pkgs and build regex
for pkg in ${PKGS}; do
DEPLOY_INFO="${DEPLOY_INFO}\`\`\`console\nzarf package deploy oci://ghcr.io/defenseunicorns/packages/$pkg:${{ needs.tag-new-version.outputs.release_tag }}\n\`\`\`\n"
done
# add the prefix
DEPLOY_INFO="${PREFIX}${DEPLOY_INFO}"
# set as GH output
echo "deploy_info=${DEPLOY_INFO}" >> $GITHUB_OUTPUT
update-release-notes:
permissions: write-all
needs: [tag-new-version, build-release-notes-update]
if: ${{ needs.tag-new-version.outputs.release_created == 'true'}}
uses: ./.github/workflows/update-release-info-from-tag.yaml
with:
tag-name: ${{ needs.tag-new-version.outputs.release_tag }}
release-body-top: ${{ needs.build-release-notes-update.outputs.header_info }}
release-body-bottom: ${{ needs.build-release-notes-update.outputs.deploy_info }}
secrets: inherit
publish-ci-dubbd-iac-aws:
permissions:
contents: read
packages: write
needs: tag-new-version
if: ${{ needs.tag-new-version.outputs.release_created == 'true'}}
uses: ./.github/workflows/publish.dubbd.package.yaml
with:
working_dir: .github/test-infra/ci-dubbd-iac-aws
secrets: inherit
publish-dubbd-aws:
permissions:
contents: read
packages: write
needs: tag-new-version
if: ${{ needs.tag-new-version.outputs.release_created == 'true'}}
uses: ./.github/workflows/publish.dubbd.package.yaml
with:
working_dir: aws/dubbd-aws
secrets: inherit
publish-dubbd-rke2:
permissions:
contents: read
packages: write
needs: tag-new-version
if: ${{ needs.tag-new-version.outputs.release_created == 'true'}}
uses: ./.github/workflows/publish.dubbd.package.yaml
with:
working_dir: rke2
secrets: inherit
publish-dubbd-k3d:
permissions:
contents: read
packages: write
needs: tag-new-version
if: ${{ needs.tag-new-version.outputs.release_created == 'true'}}
uses: ./.github/workflows/publish.dubbd.package.yaml
with:
working_dir: k3d
secrets: inherit
publish-dubbd-core:
permissions:
contents: read
packages: write
needs: tag-new-version
if: ${{ needs.tag-new-version.outputs.release_created == 'true'}}
uses: ./.github/workflows/publish.dubbd.package.yaml
with:
working_dir: defense-unicorns-distro
secrets: inherit
notify-public-uds:
needs: [tag-new-version, publish-dubbd-core, publish-dubbd-k3d, publish-dubbd-rke2, publish-dubbd-aws]
if: ${{ needs.tag-new-version.outputs.release_created == 'true'}}
uses: ./.github/workflows/slack-notify-on-new-release.yaml
secrets: inherit