Skip to content

Merge branch 'enterprise/release' into enterprise_beta #257

Merge branch 'enterprise/release' into enterprise_beta

Merge branch 'enterprise/release' into enterprise_beta #257

Workflow file for this run

# ########################################################################
# Copyright 2021 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ########################################################################
name: cd-ghcr
on:
push:
branches-ignore:
- "**"
tags:
- "v[0-9]+\.[0-9]+\.[0-9]+" # Main release tags (e.g., v1.2.3)

Check failure on line 23 in .github/workflows/cd-ghcr.io.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/cd-ghcr.io.yaml

Invalid workflow file

You have an error in your yaml syntax on line 23
- "[0-9]+\.[0-9]+\.[0-9]+_ec" # Enterprise release tags (e.g., 1.2.3_ec)
permissions:
packages: write
contents: write
deployments: write
jobs:
release:
name: Release (Main)
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
container: [container3, container3lite] # Main containers only
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
id: docker_action_meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}/${{ matrix.container }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=sha
type=sha,format=long
- id: Pull
name: Pull Container
run: |
VERSION=$(cat package/etc/VERSION)
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 }}
release-enterprise:
name: Release (Enterprise)
if: github.ref == 'refs/heads/enterprise/release' || startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
strategy:
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}}_ec
type=semver,pattern={{major}}_ec
- id: Pull
name: Pull Enterprise Container
run: |
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
done
env:
CONTAINER_SOURCE_TAGS: ${{ steps.docker_meta_enterprise.outputs.tags }}