Skip to content
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7d98cb3
Add version bump script
NullPointerDepressiveDisorder Dec 5, 2025
a02e9d2
Trigger homebrew update after release
NullPointerDepressiveDisorder Dec 5, 2025
ba518b7
Add check for existing version tag before tagging
NullPointerDepressiveDisorder Dec 5, 2025
41b22a1
Update .github/workflows/release.yml
NullPointerDepressiveDisorder Dec 5, 2025
bd46698
Update bump-version.sh
NullPointerDepressiveDisorder Dec 5, 2025
3c1a43c
Update bump-version.sh
NullPointerDepressiveDisorder Dec 5, 2025
da21e4c
Update .github/workflows/release.yml
NullPointerDepressiveDisorder Dec 5, 2025
094a95b
Merge branch 'main' into versioning
NullPointerDepressiveDisorder Dec 5, 2025
d49ac5f
Apply suggestions from code review
NullPointerDepressiveDisorder Dec 5, 2025
4818e3f
Add Homebrew Update workflow trigger
NullPointerDepressiveDisorder Dec 5, 2025
d0e1a59
Add repository_dispatch event for homebrew_release
NullPointerDepressiveDisorder Dec 5, 2025
fa06262
Update .github/workflows/release.yml
NullPointerDepressiveDisorder Dec 5, 2025
f34900b
Update .github/workflows/release.yml
NullPointerDepressiveDisorder Dec 5, 2025
65bba22
Initial plan
Copilot Dec 5, 2025
37f5170
Merge pull request #12 from NullPointerDepressiveDisorder/copilot/sub…
NullPointerDepressiveDisorder Dec 5, 2025
0819478
Update .github/workflows/release.yml
NullPointerDepressiveDisorder Dec 5, 2025
cdd47e6
Add GH_TOKEN to version retrieval in release workflow
NullPointerDepressiveDisorder Dec 5, 2025
4891f85
Update .github/workflows/release.yml
NullPointerDepressiveDisorder Dec 5, 2025
f2177e6
Fix output variable name in release workflow
NullPointerDepressiveDisorder Dec 5, 2025
ed87cc8
Update .github/workflows/release.yml
NullPointerDepressiveDisorder Dec 5, 2025
abcdd3a
Apply suggestions from code review
NullPointerDepressiveDisorder Dec 5, 2025
8dc256d
Remove Create Release step and add Homebrew trigger
NullPointerDepressiveDisorder Dec 5, 2025
5ae4d67
Update .github/workflows/release.yml
NullPointerDepressiveDisorder Dec 5, 2025
1ec7daa
Update bump-version.sh
NullPointerDepressiveDisorder Dec 5, 2025
ffe3779
Update bump-version.sh
NullPointerDepressiveDisorder Dec 5, 2025
e56e58e
Update .github/workflows/release.yml
NullPointerDepressiveDisorder Dec 5, 2025
99dfe3b
Restore release creation and add version validation to release workflow
google-labs-jules[bot] Dec 5, 2025
29a14c3
Update .github/workflows/release.yml
NullPointerDepressiveDisorder Dec 5, 2025
bb3a4fb
Restore release creation, add version validation, and fix env var case
google-labs-jules[bot] Dec 5, 2025
d267647
Restore release creation, add version validation, and fix env var cas…
google-labs-jules[bot] Dec 5, 2025
fa21bdf
Update .github/workflows/release.yml
NullPointerDepressiveDisorder Dec 5, 2025
142bbdf
Merge pull request #13 from NullPointerDepressiveDisorder/fix-release…
NullPointerDepressiveDisorder Dec 5, 2025
88b8af5
Update .github/workflows/release.yml
NullPointerDepressiveDisorder Dec 5, 2025
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
47 changes: 42 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
build:
name: Build and Release
runs-on: macos-15
outputs:
version: ${{ steps.version.outputs.VERSION }}

steps:
- name: Checkout
Expand All @@ -30,12 +32,32 @@ jobs:

- name: Get version
id: version
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ -n "${{ inputs.version }}" ]; then
echo "VERSION=${{ inputs.version }}" >> $GITHUB_OUTPUT
VERSION="${{ inputs.version }}"
VERSION="${VERSION#v}" # Remove 'v' prefix if present
elif [ "${{ github.event_name }}" == "push" ]; then
VERSION="${GITHUB_REF#refs/tags/v}" # Extract from tag ref
else
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
VERSION=$(gh release view --repo ${{ github.repository }} --json tagName -q '.tagName' 2>/dev/null || echo "")
if [ -z "$VERSION" ]; then
echo "Error: No version found. Please specify a version or create a release first."
exit 1
fi
VERSION="${VERSION#v}" # Remove 'v' prefix
Comment thread
NullPointerDepressiveDisorder marked this conversation as resolved.
fi
Comment thread
NullPointerDepressiveDisorder marked this conversation as resolved.

PROJECT_VERSION=$(sed -n 's/.*MARKETING_VERSION = \([0-9]\+\.[0-9]\+\.[0-9]\+\);.*/\1/p' MiddleDrag.xcodeproj/project.pbxproj | head -n 1)
if [ "$VERSION" != "$PROJECT_VERSION" ]; then
echo "Error: Version mismatch! Workflow version: $VERSION, Xcode project version: $PROJECT_VERSION"
echo "Please ensure project.pbxproj is updated (try running ./bump-version.sh)"
exit 1
fi
Comment thread
NullPointerDepressiveDisorder marked this conversation as resolved.

echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
echo "Using version: ${VERSION}"

- name: Build Release
run: |
Expand Down Expand Up @@ -72,11 +94,26 @@ jobs:
SHA=$(shasum -a 256 MiddleDrag-${{ steps.version.outputs.VERSION }}.zip | awk '{print $1}')
echo "SHA256=$SHA" >> $GITHUB_OUTPUT
echo "SHA256: $SHA"

- name: Create Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
with:
tag_name: v${{ steps.version.outputs.VERSION }}
name: MiddleDrag v${{ steps.version.outputs.VERSION }}
body: "## MiddleDrag v${{ steps.version.outputs.VERSION }}\n\n### SHA256\n```\n${{ steps.sha.outputs.SHA256 }}\n```\n\n### Requirements\n- macOS 14.0 or later\n- Accessibility permissions"
name: v${{ steps.version.outputs.VERSION }}
target_commitish: ${{ github.sha }}
body: |
SHA256: ${{ steps.sha.outputs.SHA256 }}
files: MiddleDrag-${{ steps.version.outputs.VERSION }}.zip

- name: Trigger Homebrew Update workflow
env:
VERSION: ${{ steps.version.outputs.VERSION }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
Comment thread
NullPointerDepressiveDisorder marked this conversation as resolved.
Outdated
-H "Accept: application/vnd.github.v3+json" \
Comment thread
NullPointerDepressiveDisorder marked this conversation as resolved.
https://api.github.com/repos/${{ github.repository }}/dispatches \
-d "{\"event_type\":\"homebrew_release\",\"client_payload\":{\"version\":\"$VERSION\"}}"
echo "✓ Triggered Homebrew update workflow"
2 changes: 2 additions & 0 deletions .github/workflows/update-homebrew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ permissions:
contents: read
Comment thread
NullPointerDepressiveDisorder marked this conversation as resolved.

Comment thread
NullPointerDepressiveDisorder marked this conversation as resolved.
Comment thread
NullPointerDepressiveDisorder marked this conversation as resolved.
Comment thread
NullPointerDepressiveDisorder marked this conversation as resolved.
on:
repository_dispatch:
types: [homebrew_release]
Comment thread
NullPointerDepressiveDisorder marked this conversation as resolved.
release:
types: [published]
workflow_dispatch:
Expand Down
66 changes: 66 additions & 0 deletions bump-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/bash
Comment thread
NullPointerDepressiveDisorder marked this conversation as resolved.
# bump-version.sh - Update version in Xcode project and create git tag

set -e

VERSION=$1

if [ -z "$VERSION" ]; then
echo "Usage: ./bump-version.sh <version>"
echo "Example: ./bump-version.sh 1.2.3"
exit 1
fi

# Remove 'v' prefix if provided
VERSION="${VERSION#v}"

# Validate semver format
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: Version must be in semver format (e.g., 1.2.3)"
exit 1
fi

Comment thread
NullPointerDepressiveDisorder marked this conversation as resolved.
# Ensure working directory is clean
if ! git diff-index --quiet HEAD --; then
echo "Error: Working directory has uncommitted changes. Please commit or stash them first."
exit 1
fi
echo "Bumping version to $VERSION..."

# Update Xcode project MARKETING_VERSION (both Debug and Release configs)
Comment thread
NullPointerDepressiveDisorder marked this conversation as resolved.
if [ ! -f "MiddleDrag.xcodeproj/project.pbxproj" ]; then
echo "Error: MiddleDrag.xcodeproj/project.pbxproj not found. Are you in the project root?"
exit 1
fi
sed -i '' -E "s/MARKETING_VERSION = [0-9]+\.[0-9]+\.[0-9]+/MARKETING_VERSION = $VERSION/g" \
MiddleDrag.xcodeproj/project.pbxproj

Comment thread
NullPointerDepressiveDisorder marked this conversation as resolved.
# Verify exactly 2 instances were updated
COUNT=$(grep -c "MARKETING_VERSION = $VERSION" MiddleDrag.xcodeproj/project.pbxproj || echo "0")
if [ "$COUNT" -ne 2 ]; then
echo "Error: Expected exactly 2 MARKETING_VERSION updates, found $COUNT"
exit 1
fi
echo "✓ Updated MARKETING_VERSION in Xcode project"

# Check if tag already exists (local or remote)
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
echo "Error: Tag v$VERSION already exists locally"
exit 1
fi
if git ls-remote --tags origin | grep -q "refs/tags/v$VERSION$"; then
echo "Error: Tag v$VERSION already exists on remote"
exit 1
fi

# Stage and commit
git add MiddleDrag.xcodeproj/project.pbxproj
git commit -m "Bump version to $VERSION"
echo "✓ Committed version change"

# Create tag
git tag "v$VERSION"
Comment thread
NullPointerDepressiveDisorder marked this conversation as resolved.
echo "✓ Created tag v$VERSION"
echo ""
echo "Done! To trigger the release workflow, run:"
echo " git push && git push --tags"
Loading