Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 5 additions & 5 deletions .github/workflows/reusable-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ on:
workflow_call:
inputs:
version:
description: "Version number (e.g., 1.0.0). If empty, will auto-increment patch version."
description: 'Version number (e.g., 1.0.0). If empty, will auto-increment patch version.'
required: false
type: string
outputs:
version:
description: "The version that was released"
description: 'The version that was released'
value: ${{ jobs.release.outputs.version }}

jobs:
Expand Down Expand Up @@ -48,11 +48,11 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo
});

// Remove 'v' prefix if present
const currentVersion = latestRelease.tag_name.replace('v', '');
const [major, minor, patch] = currentVersion.split('.').map(Number);

// Increment patch version
const nextVersion = `${major}.${minor + 1}.0`;
core.setOutput('version', nextVersion);
Expand Down Expand Up @@ -88,4 +88,4 @@ jobs:
draft: true,
prerelease: false,
target_commitish: commit
});
});
16 changes: 9 additions & 7 deletions .github/workflows/reusable-tag-docker-release-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_call:
inputs:
release_id:
description: "The ID of the release"
description: 'The ID of the release'
required: true
type: string

Expand Down Expand Up @@ -61,16 +61,20 @@ jobs:
core.setOutput('source_tag', shortSha);

// Extract version without 'v' prefix
const version = release.data.tag_name.replace('v', '');
const version = release.data.tag_name.replace(/^v/, '');
const isPreRelease = version.includes('-');

// Create semantic version parts
const [major, minor, patch] = version.split('.');
const [major, minor] = version.split('.');
const versionTags = [
release.data.tag_name, // Original tag (vX.Y.Z)
version, // X.Y.Z
release.data.tag_name, // Original tag (vX.Y.Z[-pre][+build])
version, // X.Y.Z[-pre][+build]
`${major}.${minor}`, // X.Y
major // X
];
if (!isPreRelease) {
versionTags.push('latest')
}

core.setOutput('version_tags', versionTags.join(','));

Expand All @@ -95,7 +99,6 @@ jobs:
outputs:
version_tags: ${{ steps.release_details.outputs.version_tags }}


push_gar:
needs: docker-tag
runs-on: ubuntu-latest
Expand All @@ -108,7 +111,6 @@ jobs:

env:
GOOGLE_ARTIFACT_REGISTRY_REPOSITORY: ${{ vars.GOOGLE_ARTIFACT_REGISTRY_REPOSITORY }}
GOOGLE_ARTIFACT_REGISTRY_DEFAULT_TAG: ${{ vars.GOOGLE_ARTIFACT_REGISTRY_DEFAULT_TAG }}

steps:
- name: Checkout
Expand Down