Skip to content

Commit

Permalink
chore: hotfix the spoof containing a dash in the input and add a publ…
Browse files Browse the repository at this point in the history
…ish step (#81)

* chore: fix spoof to not include a dash

* chore: fix spoof to not include a dash in the input

* add publish stage in prep for upgrade test

* fix lint
  • Loading branch information
Racer159 committed Mar 25, 2024
1 parent 213fc17 commit f9c7aac
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 5 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/tag-release.yaml
Expand Up @@ -17,3 +17,41 @@ jobs:
uses: google-github-actions/release-please-action@cc61a07e2da466bebbc19b3a7dd01d6aecb20d1e # v4
- id: release-flag
run: echo "release_created=${{ steps.tag.outputs.release_created || false }}" >> $GITHUB_OUTPUT

publish-package:
needs: tag-new-version
if: ${{ needs.tag-new-version.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
strategy:
matrix:
flavor: [test]
name: Publish ${{ matrix.flavor }}

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Environment setup
uses: ./.github/actions/setup
with:
username: ${{secrets.IRON_BANK_ROBOT_USERNAME}}
password: ${{secrets.IRON_BANK_ROBOT_PASSWORD}}

- name: Login to GHCR
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
with:
registry: ghcr.io
username: dummy
password: ${{ secrets.GITHUB_TOKEN }}

- name: Publish Package
run: uds run publish-podinfo --set FLAVOR=${{ matrix.flavor }}

- name: Save logs
if: always()
uses: ./.github/actions/save-logs
with:
suffix: ${{ matrix.flavor }}-${{ github.run_id }}-${{ github.run_attempt }}
8 changes: 6 additions & 2 deletions bundle/uds-bundle.yaml
Expand Up @@ -2,9 +2,13 @@ kind: UDSBundle
metadata:
name: test
description: The testing UDS bundle
version: 0.0.1
# x-release-please-start-version
version: 0.3.5
# x-release-please-end

packages:
- name: podinfo
path: ../
ref: 0.0.1
# x-release-please-start-version
ref: 0.3.5
# x-release-please-end
7 changes: 6 additions & 1 deletion release-please-config.json
Expand Up @@ -9,7 +9,12 @@
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
{ "type": "chore", "section": "Miscellaneous", "hidden": false }
],
"versioning": "default"
"versioning": "default",
"extra-files": [
"bundle/uds-bundle.yaml",
"tasks.yaml",
"zarf.yaml"
]
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
Expand Down
23 changes: 23 additions & 0 deletions tasks.yaml
Expand Up @@ -3,6 +3,7 @@ includes:
- create: ./tasks/create.yaml
- deploy: ./tasks/deploy.yaml
- lint: ./tasks/lint.yaml
- publish: ./tasks/publish.yaml

tasks:
- name: registry-login
Expand All @@ -28,6 +29,26 @@ tasks:
- task: create-podinfo-package
- task: create:test-bundle

- name: publish-podinfo
description: Build and publish the packages
actions:
- description: Create the AMD64 package
task: create:package
with:
architecture: amd64

- description: Create the ARM64 package
task: create:package
with:
architecture: arm64

- description: Publish the packages
task: publish:package
with:
# x-release-please-start-version
version: 0.3.5
# x-release-please-end

- name: test
description: Test and validate cluster is deployed with podinfo
actions:
Expand All @@ -38,6 +59,8 @@ tasks:
namespace: podinfo
condition: available

# CI will execute the following (via .github/actions/test) so they need to be here with these names

- name: test-package
description: Test the Podinfo package from the current branch
actions:
Expand Down
2 changes: 1 addition & 1 deletion tasks/pull.yaml
Expand Up @@ -27,7 +27,7 @@ tasks:
# TODO (@WSTARR): This is currently needed to get around the chicken+egg condition when release please updates the version in GH
- description: Spoof the latest release to the current version
cmd: |
if [ ${{ .inputs.spoof-release }} != "false" ]; then
if [ ${{ .inputs.spoof_release }} != "false" ]; then
CURRENT_VERSION=$(cat zarf.yaml | yq .metadata.version)
CURRENT_PKG_NAME=$(cat zarf.yaml | yq .metadata.name)
test -f zarf-package-${CURRENT_PKG_NAME}-${UDS_ARCH}-${CURRENT_VERSION}.tar.zst || mv zarf-package-${CURRENT_PKG_NAME}-${UDS_ARCH}-*.tar.zst zarf-package-${CURRENT_PKG_NAME}-${UDS_ARCH}-${CURRENT_VERSION}.tar.zst
Expand Down
4 changes: 3 additions & 1 deletion zarf.yaml
@@ -1,7 +1,9 @@
kind: ZarfPackageConfig
metadata:
name: podinfo
version: 0.0.1
# x-release-please-start-version
version: 0.3.5
# x-release-please-end

components:
- name: podinfo-kustomize
Expand Down

0 comments on commit f9c7aac

Please sign in to comment.