From b2ed83f1fd6b5bb0fa759a39cb41cfef0b36be03 Mon Sep 17 00:00:00 2001 From: Clint Date: Mon, 4 Nov 2024 12:45:20 -0600 Subject: [PATCH] fix: port uds-common/setup action (#121) * fix: port uds-common/setup action Signed-off-by: catsby * chore: re-work to re-use uds-common task for setup-environment Signed-off-by: catsby * fix missing uds cli Signed-off-by: catsby * fix typo Signed-off-by: catsby * add setup environment task to other GHAs Signed-off-by: catsby --------- Signed-off-by: catsby --- .github/workflows/build-test.yaml | 18 +++++++++++++----- .github/workflows/publish-image.yaml | 25 +++++++++++++------------ .github/workflows/tag-and-release.yaml | 23 ++++++++++++----------- tasks.yaml | 3 +++ 4 files changed, 41 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index 96ce302..72d9f1e 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -22,12 +22,20 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - - name: Setup UDS - if: always() - uses: defenseunicorns/uds-common/.github/actions/setup@e3008473beab00b12a94f9fcc7340124338d5c08 # v0.13.1 + - name: Install UDS CLI + uses: defenseunicorns/setup-uds@b987a32bac3baeb67bfb08f5e1544e2f9076ee8a # v1.0.0 with: - username: ${{secrets.IRON_BANK_ROBOT_USERNAME}} - password: ${{secrets.IRON_BANK_ROBOT_PASSWORD}} + # renovate: datasource=github-tags depName=defenseunicorns/uds-cli versioning=semver + version: v0.18.0 + + - name: Environment setup + run: | + uds run actions:setup-environment \ + --set REGISTRY1_USERNAME="${{ secrets.IRON_BANK_ROBOT_USERNAME }}" \ + --set REGISTRY1_PASSWORD="${{ secrets.IRON_BANK_ROBOT_PASSWORD }}" \ + --set GH_TOKEN="${{ secrets.GITHUB_TOKEN }}" \ + --set CHAINGUARD_IDENTITY="${{ secrets.CHAINGUARD_IDENTITY }}" + shell: bash # Step is not currently being used, could be uncommented if custom image support is needed in the future # - name: Build the custom k3s image diff --git a/.github/workflows/publish-image.yaml b/.github/workflows/publish-image.yaml index 423a4f6..a977e3a 100644 --- a/.github/workflows/publish-image.yaml +++ b/.github/workflows/publish-image.yaml @@ -25,19 +25,20 @@ jobs: - uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 - - name: Setup UDS - if: always() - uses: defenseunicorns/uds-common/.github/actions/setup@e3008473beab00b12a94f9fcc7340124338d5c08 # v0.13.1 + - name: Install UDS CLI + uses: defenseunicorns/setup-uds@b987a32bac3baeb67bfb08f5e1544e2f9076ee8a # v1.0.0 with: - username: ${{secrets.IRON_BANK_ROBOT_USERNAME}} - password: ${{secrets.IRON_BANK_ROBOT_PASSWORD}} - - - name: Login to GHCR - uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3 - with: - registry: ghcr.io - username: dummy - password: ${{ secrets.GITHUB_TOKEN }} + # renovate: datasource=github-tags depName=defenseunicorns/uds-cli versioning=semver + version: v0.18.0 + + - name: Environment setup + run: | + uds run actions:setup-environment \ + --set REGISTRY1_USERNAME="${{ secrets.IRON_BANK_ROBOT_USERNAME }}" \ + --set REGISTRY1_PASSWORD="${{ secrets.IRON_BANK_ROBOT_PASSWORD }}" \ + --set GH_TOKEN="${{ secrets.GITHUB_TOKEN }}" \ + --set CHAINGUARD_IDENTITY="${{ secrets.CHAINGUARD_IDENTITY }}" + shell: bash - name: Publish the custom k3s image run: uds run publish-image --set VERSION=${{matrix.version}} --no-progress diff --git a/.github/workflows/tag-and-release.yaml b/.github/workflows/tag-and-release.yaml index 15a0026..c805beb 100644 --- a/.github/workflows/tag-and-release.yaml +++ b/.github/workflows/tag-and-release.yaml @@ -32,19 +32,20 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - - name: Setup UDS - if: always() - uses: defenseunicorns/uds-common/.github/actions/setup@e3008473beab00b12a94f9fcc7340124338d5c08 # v0.13.1 + - name: Install UDS CLI + uses: defenseunicorns/setup-uds@b987a32bac3baeb67bfb08f5e1544e2f9076ee8a # v1.0.0 with: - username: ${{secrets.IRON_BANK_ROBOT_USERNAME}} - password: ${{secrets.IRON_BANK_ROBOT_PASSWORD}} + # renovate: datasource=github-tags depName=defenseunicorns/uds-cli versioning=semver + version: v0.18.0 - - name: Login to GHCR - uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3 - with: - registry: ghcr.io - username: dummy - password: ${{ secrets.GITHUB_TOKEN }} + - name: Environment setup + run: | + uds run actions:setup-environment \ + --set REGISTRY1_USERNAME="${{ secrets.IRON_BANK_ROBOT_USERNAME }}" \ + --set REGISTRY1_PASSWORD="${{ secrets.IRON_BANK_ROBOT_PASSWORD }}" \ + --set GH_TOKEN="${{ secrets.GITHUB_TOKEN }}" \ + --set CHAINGUARD_IDENTITY="${{ secrets.CHAINGUARD_IDENTITY }}" + shell: bash - name: Publish the capability run: | diff --git a/tasks.yaml b/tasks.yaml index 00fb80c..b03905f 100644 --- a/tasks.yaml +++ b/tasks.yaml @@ -1,3 +1,6 @@ +includes: + - actions: https://raw.githubusercontent.com/defenseunicorns/uds-common/refs/tags/v1.2.2/tasks/actions.yaml + variables: - name: VERSION default: "v1.30.4-k3s1"