Simple App to help @jaspermayone make it through COMP1050 with a professor who won't use version control.

Fix release script to use existing tags

- Check if tag exists before creating new one
- Use existing tag and preserve custom messages
- Force push tag in case it was updated
- Update docs to recommend creating tag first

+33 -40
+21 -36
RELEASING.md
··· 4 4 5 5 ## Local Release Script (Recommended) 6 6 7 - The easiest way to create a release is using the local `release.sh` script: 7 + The easiest way to create a release is using the local `release.sh` script. 8 8 9 + **Option 1: Create tag first (recommended for custom tag messages)** 9 10 ```bash 11 + # Create a tag with a custom message 12 + git tag -a v1.0.0 -m "Version 1.0.0 - Your custom message" 13 + 14 + # Run the release script (will use existing tag) 15 + ./release.sh v1.0.0 16 + ``` 17 + 18 + **Option 2: Let the script create the tag** 19 + ```bash 20 + # Script will create a simple tag automatically 10 21 ./release.sh v1.0.0 11 22 ``` 12 23 13 24 This script will: 14 25 1. Build the app with Developer ID signing 15 26 2. Notarize the app with Apple 16 - 3. Create a GitHub release with the signed .zip 17 - 4. Calculate the SHA256 hash 18 - 5. Automatically update the Homebrew cask 19 - 6. Commit and push the cask update 27 + 3. Use existing git tag or create one if needed 28 + 4. Push the tag to GitHub 29 + 5. Create a GitHub release with the signed .zip 30 + 6. Calculate the SHA256 hash 31 + 7. Automatically update the Homebrew cask 32 + 8. Commit and push the cask update 20 33 21 34 **Prerequisites:** 22 35 - `gh` CLI installed (`brew install gh`) and authenticated ··· 74 87 4. Enter "GitHub Actions Notarization" as the name 75 88 5. Copy the generated password and save it as APPLE_ID_PASSWORD in GitHub 76 89 77 - ## Creating a Release 90 + ## Manual GitHub Actions Release (Alternative) 78 91 79 - Once secrets are configured: 92 + If you prefer to use GitHub Actions instead of the local script: 80 93 81 94 ```bash 82 95 # Ensure you're on main branch with latest changes ··· 88 101 git push origin v1.0.0 89 102 ``` 90 103 91 - The GitHub Actions workflow will automatically: 92 - - Build and sign the app 93 - - Notarize with Apple (takes 5-10 minutes) 94 - - Create a GitHub release with ZipMerge.zip 95 - - Include SHA256 hash in release notes 96 - 97 - ## Updating the Homebrew Cask 98 - 99 - After the release completes: 100 - 101 - 1. Copy the SHA256 from the release notes 102 - 2. Update `/Users/jsp/dev/projects/homebrew-tap/Casks/zipmerge.rb`: 103 - ```ruby 104 - sha256 "THE_SHA256_FROM_RELEASE_NOTES" 105 - ``` 106 - 3. Update version if needed 107 - 4. Commit and push to homebrew-tap: 108 - ```bash 109 - cd /Users/jsp/dev/projects/homebrew-tap 110 - git add Casks/zipmerge.rb 111 - git commit -m "Update zipmerge to v1.0.0" 112 - git push 113 - ``` 114 - 115 - Users can then install with: 116 - ```bash 117 - brew tap jaspermayone/tap 118 - brew install --cask zipmerge 119 - ``` 104 + The GitHub Actions workflow will automatically build, sign, notarize, and create a release. However, you'll need to manually update the Homebrew cask afterward (the local script does this automatically). 120 105 121 106 ## Troubleshooting 122 107
+12 -4
release.sh
··· 124 124 SHA256=$(shasum -a 256 ZipMerge.zip | awk '{print $1}') 125 125 echo -e "SHA256: ${YELLOW}${SHA256}${NC}" 126 126 127 - # Create git tag 128 - echo -e "${GREEN}🏷️ Creating git tag...${NC}" 129 - git tag -a "$VERSION" -m "Release $VERSION" || echo "Tag already exists" 130 - git push origin "$VERSION" || echo "Tag already pushed" 127 + # Ensure git tag exists and is pushed 128 + echo -e "${GREEN}🏷️ Ensuring git tag exists...${NC}" 129 + if git rev-parse "$VERSION" >/dev/null 2>&1; then 130 + echo "Tag $VERSION already exists locally" 131 + else 132 + echo "Creating tag $VERSION" 133 + git tag -a "$VERSION" -m "Release $VERSION" 134 + fi 135 + 136 + # Push the tag (force in case it was updated) 137 + echo "Pushing tag to origin..." 138 + git push origin "$VERSION" 2>/dev/null || git push --force origin "$VERSION" 131 139 132 140 # Create GitHub release 133 141 echo -e "${GREEN}📤 Creating GitHub release...${NC}"