Skip to content

Commit

Permalink
Publish the package
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikael Vanhemert committed Dec 18, 2023
1 parent f80e917 commit 5f87140
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/tag-and-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish UDS Package Gitlab

on:
push:
branches:
- main

jobs:
tag-new-version:
name: Tag New Version
permissions: write-all
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release-flag.outputs.release_created }}
steps:
- name: Create release tag
id: tag
uses: google-github-actions/release-please-action@v3
with:
command: manifest
- 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
name: Publish package

permissions:
contents: read
packages: write

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

- name: Environment setup
uses: ./.github/actions/setup

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

- name: Publish Package
run: uds run -f tasks/publish.yaml package
2 changes: 1 addition & 1 deletion tasks/create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tasks:
- name: gitlab-package
description: Create the UDS Gitlab Zarf Package
actions:
- cmd: zarf package create --confirm --no-progress --architecture=${UDS_ARCH} --flavor registry1
- cmd: zarf package create --confirm --no-progress --architecture=${ZARF_ARCHITECTURE} --flavor registry1

- name: dependency-package
description: Create the Minio, PostgreSQL, and Redis Dependency Zarf Packages
Expand Down
25 changes: 25 additions & 0 deletions tasks/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
variables:
- name: TARGET_REPO
default: oci://ghcr.io/defenseunicorns/packages/uds

- name: VERSION
description: The version of the package to build
# x-release-please-start-version
default: "16.5.1-0"
# x-release-please-end

tasks:
- name: package
description: Build and publish the packages
actions:
- description: Create the packages
cmd: |
set -e
ZARF_ARCHITECTURE=amd64 uds run -f tasks/create.yaml gitlab-package --no-progress
ZARF_ARCHITECTURE=arm64 uds run -f tasks/create.yaml gitlab-package --no-progress
- description: Publish the packages
cmd: |
set -e
zarf package publish zarf-package-gitlab-amd64-${VERSION}.tar.zst ${TARGET_REPO}
zarf package publish zarf-package-gitlab-arm64-${VERSION}.tar.zst ${TARGET_REPO}

0 comments on commit 5f87140

Please sign in to comment.