Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions .github/workflows/push-artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ on:
push:
branches:
- "main"
tags:
- '*.*.*'
workflow_call:
inputs:
version:
description: 'Package version to use (e.g., v1.0.0)'
required: false
type: string

permissions:
contents: read
Expand All @@ -35,19 +39,17 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Extract package version from tag
if: startsWith(github.ref, 'refs/tags/')
- name: Set package version
run: |
PACKAGE_VERSION=${GITHUB_REF_NAME}
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
echo $PACKAGE_VERSION

- name: Extract package version from branch commit
if: startsWith(github.ref, 'refs/heads/')
run: |
# We add a 'g' prefix to the hash.
# This prevents "all-number" hashes starting with 0 from breaking Helm (invalid semver)
PACKAGE_VERSION=v0.0.0-g$(git rev-parse --short HEAD)
if [ -n "${{ inputs.version }}" ]; then
# Use version provided by workflow_call
PACKAGE_VERSION="${{ inputs.version }}"
else
# Extract from commit hash for main branch pushes
# We add a 'g' prefix to the hash.
# This prevents "all-number" hashes starting with 0 from breaking Helm (invalid semver)
PACKAGE_VERSION=v0.0.0-g$(git rev-parse --short HEAD)
fi
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
echo $PACKAGE_VERSION
- name: Set up Go
Expand Down Expand Up @@ -87,4 +89,4 @@ jobs:

- name: Push Helm Chart
run: |
helm push ./grove-charts-$PACKAGE_VERSION.tgz oci://$DOCKER_REGISTRY
helm push ./grove-charts-$PACKAGE_VERSION.tgz oci://$DOCKER_REGISTRY
69 changes: 69 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# /*
# Copyright 2025 The Grove Authors.
#
# 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: Release

on:
release:
types: [published]

permissions:
contents: write
packages: write

jobs:
push-artifacts:
name: Push Artifacts
uses: ./.github/workflows/push-artifacts.yaml
with:
version: ${{ github.event.release.tag_name }}
secrets: inherit

git-tags:
name: Push Go Module Tags
runs-on: ubuntu-latest
needs: push-artifacts
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Extract package version from tag
run: |
PACKAGE_VERSION=${{ github.event.release.tag_name }}
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
echo $PACKAGE_VERSION

- name: Push Go Module Tags
run: |
echo "Creating and pushing Go module tags..."
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

# Validate git configuration
echo "Git user configuration:"
echo " user.name: $(git config user.name)"
echo " user.email: $(git config user.email)"
echo " Authenticated as: ${{ github.actor }}"

# Create tags for Go modules
git tag operator/api/$PACKAGE_VERSION
git tag operator/$PACKAGE_VERSION
git tag scheduler/api/$PACKAGE_VERSION

# Push all module tags
git push origin operator/api/$PACKAGE_VERSION operator/$PACKAGE_VERSION scheduler/api/$PACKAGE_VERSION

echo "✓ Go module tags pushed successfully"
Loading