From 7fa7a5026f5c60122e73c824835ac52d5e37a290 Mon Sep 17 00:00:00 2001 From: Nicos Karagieorgopulus Date: Sun, 31 May 2026 22:12:04 +0200 Subject: [PATCH 1/3] Add sdlc formula and update workflow Co-Authored-By: Claude Sonnet 4.6 (1M context) --- .github/workflows/update-sdlc-formula.yml | 139 ++++++++++++++++++++++ sdlc.rb | 15 +++ 2 files changed, 154 insertions(+) create mode 100644 .github/workflows/update-sdlc-formula.yml create mode 100644 sdlc.rb diff --git a/.github/workflows/update-sdlc-formula.yml b/.github/workflows/update-sdlc-formula.yml new file mode 100644 index 0000000..fab3036 --- /dev/null +++ b/.github/workflows/update-sdlc-formula.yml @@ -0,0 +1,139 @@ +name: Update SDLC Formula + +on: + workflow_dispatch: + inputs: + version: + description: 'Release version (e.g., v0.1.2)' + required: true + type: string + +permissions: + contents: write + pull-requests: write + +jobs: + update-formula: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + + - name: Fetch SHA256 from GitLab + id: calculate-sha + run: | + VERSION="${{ github.event.inputs.version }}" + # Ensure version starts with 'v' for the tag + if [[ ! "$VERSION" =~ ^v ]]; then + VERSION="v${VERSION}" + fi + + BASE_URL="https://gitlab.com/api/v4/projects/82736572/packages/generic/sdlc/${VERSION}" + TARBALL="sdlc-${VERSION}-darwin-universal.tar.gz" + URL="${BASE_URL}/${TARBALL}" + SHA256_URL="${URL}.sha256" + + echo "Fetching SHA256 from ${SHA256_URL}" + + # Download SHA256 file with error checking + if ! curl -L "${SHA256_URL}" \ + --header "PRIVATE-TOKEN: ${{ secrets.GITLAB_TOKEN }}" \ + -o sdlc.sha256 -f; then + echo "❌ Failed to fetch SHA256 for ${VERSION}" + echo "❌ URL: ${SHA256_URL}" + echo "❌ This release may not exist. Please check:" + echo " https://gitlab.com/Nicos.Karagieorgopulus/ai-sdlc/-/releases" + exit 1 + fi + + # Parse SHA256 (handles both 'hash' and 'hash filename' formats) + SHA256=$(awk '{print $1}' sdlc.sha256) + + if [ -z "$SHA256" ]; then + echo "❌ Failed to parse SHA256 from file" + cat sdlc.sha256 + exit 1 + fi + + echo "✅ SHA256: ${SHA256}" + echo "✅ URL: ${URL}" + + echo "url=${URL}" >> $GITHUB_OUTPUT + echo "sha256=${SHA256}" >> $GITHUB_OUTPUT + echo "version=${VERSION}" >> $GITHUB_OUTPUT + + - name: Update sdlc.rb formula + run: | + URL="${{ steps.calculate-sha.outputs.url }}" + SHA256="${{ steps.calculate-sha.outputs.sha256 }}" + + # Update the URL line + sed -i "s|url \".*\"|url \"${URL}\"|" sdlc.rb + + # Update the SHA256 line + sed -i "s|sha256 \".*\"|sha256 \"${SHA256}\"|" sdlc.rb + + echo "Updated sdlc.rb with:" + echo " URL: ${URL}" + echo " SHA256: ${SHA256}" + + - name: Verify formula syntax + run: | + # Simple Ruby syntax check + ruby -c sdlc.rb + + echo "Formula syntax is valid" + + - name: Create branch and push changes + run: | + # Configure git + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + # Create branch name + BRANCH_NAME="update-sdlc-${{ steps.calculate-sha.outputs.version }}" + + # Delete branch if it exists locally + git branch -D "$BRANCH_NAME" 2>/dev/null || true + + # Delete branch if it exists remotely + git push origin --delete "$BRANCH_NAME" 2>/dev/null || true + + # Create and switch to new branch + git checkout -b "$BRANCH_NAME" + + # Add and commit changes + git add sdlc.rb + git commit -m "Update sdlc formula to ${{ steps.calculate-sha.outputs.version }}" + + # Push the branch (force push to handle any conflicts) + git push --force origin "$BRANCH_NAME" + + echo "✅ Branch pushed successfully!" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create Pull Request + run: | + BRANCH_NAME="update-sdlc-${{ steps.calculate-sha.outputs.version }}" + + gh pr create \ + --title "Update sdlc formula to ${{ steps.calculate-sha.outputs.version }}" \ + --body "This PR updates the sdlc formula to version \`${{ steps.calculate-sha.outputs.version }}\`. + + ## Changes + - **Updated URL to:** \`${{ steps.calculate-sha.outputs.url }}\` + - **Updated SHA256 to:** \`${{ steps.calculate-sha.outputs.sha256 }}\` + + The formula has been validated with Ruby syntax check. + + **Auto-generated by GitHub Actions** 🤖" \ + --head "$BRANCH_NAME" \ + --base main + + echo "✅ Pull request created successfully!" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/sdlc.rb b/sdlc.rb new file mode 100644 index 0000000..fa669e8 --- /dev/null +++ b/sdlc.rb @@ -0,0 +1,15 @@ +class Sdlc < Formula + desc "AI-driven software development lifecycle CLI tool" + homepage "https://gitlab.com/Nicos.Karagieorgopulus/ai-sdlc" + url "https://gitlab.com/api/v4/projects/82736572/packages/generic/sdlc/v0.1.2/sdlc-v0.1.2-darwin-universal.tar.gz" + sha256 "placeholder_run_update_sdlc_workflow_to_set_correct_value" + license "MIT" + + def install + bin.install "sdlc" + end + + test do + system "bin/sdlc", "--version" + end +end From 9b828e211bbe1a32699be03aea2732907fbfd5b3 Mon Sep 17 00:00:00 2001 From: Nicos Karagieorgopulus Date: Mon, 1 Jun 2026 08:46:28 +0200 Subject: [PATCH 2/3] sdlc updates --- .github/workflows/update-sdlc-formula.yml | 6 +++--- sdlc.rb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update-sdlc-formula.yml b/.github/workflows/update-sdlc-formula.yml index fab3036..f22f804 100644 --- a/.github/workflows/update-sdlc-formula.yml +++ b/.github/workflows/update-sdlc-formula.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: version: - description: 'Release version (e.g., v0.1.2)' + description: 'Release version (e.g., v0.1.0)' required: true type: string @@ -31,7 +31,7 @@ jobs: VERSION="v${VERSION}" fi - BASE_URL="https://gitlab.com/api/v4/projects/82736572/packages/generic/sdlc/${VERSION}" + BASE_URL="https://gitlab.com/api/v4/projects/82745716/packages/generic/sdlc/${VERSION}" TARBALL="sdlc-${VERSION}-darwin-universal.tar.gz" URL="${BASE_URL}/${TARBALL}" SHA256_URL="${URL}.sha256" @@ -45,7 +45,7 @@ jobs: echo "❌ Failed to fetch SHA256 for ${VERSION}" echo "❌ URL: ${SHA256_URL}" echo "❌ This release may not exist. Please check:" - echo " https://gitlab.com/Nicos.Karagieorgopulus/ai-sdlc/-/releases" + echo " https://gitlab.com/nicos.ka/ai-sdlc/-/releases" exit 1 fi diff --git a/sdlc.rb b/sdlc.rb index fa669e8..c10a726 100644 --- a/sdlc.rb +++ b/sdlc.rb @@ -1,7 +1,7 @@ class Sdlc < Formula desc "AI-driven software development lifecycle CLI tool" - homepage "https://gitlab.com/Nicos.Karagieorgopulus/ai-sdlc" - url "https://gitlab.com/api/v4/projects/82736572/packages/generic/sdlc/v0.1.2/sdlc-v0.1.2-darwin-universal.tar.gz" + homepage "https://gitlab.com/nicos.ka/ai-sdlc" + url "https://gitlab.com/api/v4/projects/82745716/packages/generic/sdlc/v0.0.1/sdlc-v0.0.1-darwin-universal.tar.gz" sha256 "placeholder_run_update_sdlc_workflow_to_set_correct_value" license "MIT" From 120df47cb9e6fb7bbbe42de2a890fe8b21ec3971 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 1 Jun 2026 06:48:29 +0000 Subject: [PATCH 3/3] Update sdlc formula to v0.0.1 --- sdlc.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdlc.rb b/sdlc.rb index c10a726..273e7e2 100644 --- a/sdlc.rb +++ b/sdlc.rb @@ -2,7 +2,7 @@ class Sdlc < Formula desc "AI-driven software development lifecycle CLI tool" homepage "https://gitlab.com/nicos.ka/ai-sdlc" url "https://gitlab.com/api/v4/projects/82745716/packages/generic/sdlc/v0.0.1/sdlc-v0.0.1-darwin-universal.tar.gz" - sha256 "placeholder_run_update_sdlc_workflow_to_set_correct_value" + sha256 "c74b267f704cc871f752d164dadfcd7bcb72c95a51c833d93f14f77dcf9b2c90" license "MIT" def install