Skip to content

Commit

Permalink
feat: enterprise release workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
rjha-splunk committed Feb 4, 2025
1 parent a7c8c28 commit 44c54f3
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 17 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/cd-ghcr.io.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ on:
branches-ignore:
- "**"
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+" # Enterprise releases
- "v[0-9]+\.[0-9]+\.[0-9]+" # Main release tags (e.g., v1.2.3)
- "[0-9]+\.[0-9]+\.[0-9]+_ec" # Enterprise release tags (e.g., 1.2.3_ec)

permissions:
packages: write
Expand All @@ -36,7 +36,7 @@ jobs:
strategy:
max-parallel: 1
matrix:
container: [container3, container3lite] # Exclude enterprise from main releases
container: [container3, container3lite] # Main containers only
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -69,7 +69,11 @@ jobs:
name: Pull Container
run: |
VERSION=$(cat package/etc/VERSION)
for line in $CONTAINER_SOURCE_TAGS; do echo working on "$line"; /tmp/regctl image copy ghcr.io/${{ github.repository }}/${{ matrix.container }}:$VERSION $line; done
echo "Main version: $VERSION"
for line in $CONTAINER_SOURCE_TAGS; do
echo "Copying $VERSION -> $line"
/tmp/regctl image copy ghcr.io/${{ github.repository }}/${{ matrix.container }}:$VERSION $line
done
env:
CONTAINER_SOURCE_TAGS: ${{ steps.docker_action_meta.outputs.tags }}

Expand All @@ -81,39 +85,36 @@ jobs:
max-parallel: 1
matrix:
container: [enterprise]

steps:
- uses: actions/checkout@v4
with:
submodules: false

- name: Setup regctl
run: |
curl -L https://github.com/regclient/regclient/releases/download/v0.4.7/regctl-linux-amd64 >/tmp/regctl
chmod 755 /tmp/regctl
- name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta (Enterprise)
id: docker_meta_enterprise
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}/enterprise
tags: |
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}_ec
type=semver,pattern={{major}}_ec
- id: Pull
name: Pull Enterprise Container
run: |
VERSION=$(cat package/etc/ENTERPRISE_VERSION)
echo "Enterprise version from file: $VERSION"
VERSION=$(cat package/etc/VERSION)
if [[ $VERSION != *_ec ]]; then
VERSION="${VERSION}_ec"
fi
echo "Enterprise version: $VERSION"
for line in $CONTAINER_SOURCE_TAGS; do
echo "Copying $VERSION -> $line"
/tmp/regctl image copy ghcr.io/${{ github.repository }}/enterprise:$VERSION $line
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/ci-enterprise.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ jobs:
dry_run: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set Enterprise Version
id: set_enterprise_version
run: |
NEW_VER="${{ steps.version.outputs.new_release_version }}"
if [[ "$NEW_VER" != *_ec ]]; then
NEW_VER="${NEW_VER}_ec"
fi
echo "enterprise_version=$NEW_VER" >> $GITHUB_OUTPUT
echo "Using enterprise version: $NEW_VER"
- name: Docker meta
id: docker_action_meta
uses: docker/metadata-action@v5
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+" ### Enterprise release
- "[0-9]+.[0-9]+.[0-9]+_ec" ### Enterprise release

permissions:
actions: read
Expand All @@ -23,4 +23,4 @@ jobs:
- name: Update Semver Tags (Enterprise)
uses: tchupp/actions-update-semver-tags@v1
with:
tag_prefix: "" #Remove unnecessary v
tag_prefix: ""
1 change: 0 additions & 1 deletion package/etc/ENTERPRISE_VERSION

This file was deleted.

0 comments on commit 44c54f3

Please sign in to comment.