Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 12 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ on:
workflow_dispatch:
inputs:
version:
description: 'Semantic Version Tag (e.g. v0.1.0)'
description: 'Semantic Version Tag (e.g. v1.0.0-rc.26)'
required: true
default: 'v0.1.0'
default: 'v1.0.0-rc.26'

jobs:
release:
Expand All @@ -20,19 +20,24 @@ jobs:
packages: write

steps:
- name: Determine Release Tag
- name: Determine Release Tag & Type
id: release_tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
TAG="${{ inputs.version }}"
else
TAG="${{ github.ref_name }}"
fi
Comment thread
matheus-souza marked this conversation as resolved.
Outdated
if ! echo "$TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "Error: Tag '$TAG' does not match semver format vX.Y.Z"
if ! echo "$TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$'; then
echo "Error: Tag '$TAG' does not match semver format vX.Y.Z or vX.Y.Z-rc.N"
exit 1
fi
echo "tag=$TAG" >> $GITHUB_OUTPUT
if echo "$TAG" | grep -q '\-rc'; then
echo "is_prerelease=true" >> $GITHUB_OUTPUT
else
echo "is_prerelease=false" >> $GITHUB_OUTPUT
fi

- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -60,7 +65,7 @@ jobs:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}},value=${{ steps.release_tag.outputs.tag }}
type=semver,pattern={{major}}.{{minor}},value=${{ steps.release_tag.outputs.tag }}
type=raw,value=${{ steps.release_tag.outputs.tag }}
Comment thread
matheus-souza marked this conversation as resolved.
type=raw,value=latest

- name: Build & Push Multi-Arch Container Image
Expand Down Expand Up @@ -90,6 +95,7 @@ jobs:
with:
tag_name: ${{ steps.release_tag.outputs.tag }}
name: Release ${{ steps.release_tag.outputs.tag }}
prerelease: ${{ steps.release_tag.outputs.is_prerelease == 'true' }}
generate_release_notes: true
body: |
## 🚀 InfraMap Single Binary Container Release
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ docker-run: docker-build ## Start production Docker Compose environment
@echo "Starting production Docker Compose environment..."
docker compose up -d

release: ## Create and push semantic version git tag (usage: make release VERSION=v0.1.0)
@if [ -z "$(VERSION)" ]; then echo "Error: VERSION is required (e.g. make release VERSION=v0.1.0)"; exit 1; fi
@if ! echo "$(VERSION)" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+$$'; then echo "Error: VERSION must match semver pattern vX.Y.Z (e.g. v0.1.0)"; exit 1; fi
release: ## Create and push semantic version git tag (usage: make release VERSION=v1.0.0-rc.26)
@if [ -z "$(VERSION)" ]; then echo "Error: VERSION is required (e.g. make release VERSION=v1.0.0-rc.26)"; exit 1; fi
@if ! echo "$(VERSION)" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$$'; then echo "Error: VERSION must match semver pattern vX.Y.Z or vX.Y.Z-rc.N (e.g. v1.0.0-rc.26)"; exit 1; fi
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
@echo "Creating and pushing tag $(VERSION)..."
git tag -a $(VERSION) -m "Release $(VERSION)"
git push origin $(VERSION)
Expand Down
Loading