From 89d519c7a87973595a50ab32dae9a086e0aba6cd Mon Sep 17 00:00:00 2001 From: JP Simard Date: Mon, 30 Mar 2026 12:07:45 -0400 Subject: [PATCH] Fix release process, fix Jazzy CI, remove CocoaPods * Fix `make release`: the `installables` target depended on `clean`, which deleted build artifacts before `install` could copy them. Move cleanup into the recipe body so it runs after `build`. * Remove CocoaPods support: delete `SourceKittenFramework.podspec`, the `cocoapods` gem from `Gemfile`, and the `make publish` target. CocoaPods trunk is going read-only on December 2, 2026: https://blog.cocoapods.org/CocoaPods-Specs-Repo/ BrewTestBot auto-bumps the Homebrew formula, so `make publish` had no remaining use. * Fix Jazzy CI: `macos-13` and Ruby 2.7 are both EOL. Update to `macos-15` and Ruby 3.3. Bump `actions/checkout` to v4. * Update `Releasing.md`: use `gh release create` instead of the web UI, update the example version, and document the missing step of adding an empty changelog section after releasing. * Remove CocoaPods reference from `CONTRIBUTING.md`. --- .bcr/source.template.json | 2 +- .github/workflows/jazzy.yml | 8 +-- CONTRIBUTING.md | 2 +- Gemfile | 1 - Gemfile.lock | 96 ++++++++++++++++++----------------- Makefile | 50 +++++++++++++----- Releasing.md | 35 ++++++++----- SourceKittenFramework.podspec | 15 ------ 8 files changed, 115 insertions(+), 94 deletions(-) delete mode 100644 SourceKittenFramework.podspec diff --git a/.bcr/source.template.json b/.bcr/source.template.json index 594c1c1af..2ad2f8762 100644 --- a/.bcr/source.template.json +++ b/.bcr/source.template.json @@ -1,5 +1,5 @@ { - "url": "https://github.com/jpsim/SourceKitten/archive/refs/tags/{TAG}.tar.gz", + "url": "https://github.com/jpsim/SourceKitten/releases/download/{TAG}/SourceKitten-{TAG}.tar.gz", "integrity": "", "strip_prefix": "SourceKitten-{TAG}" } diff --git a/.github/workflows/jazzy.yml b/.github/workflows/jazzy.yml index 4d27a1153..796d2da4b 100644 --- a/.github/workflows/jazzy.yml +++ b/.github/workflows/jazzy.yml @@ -8,13 +8,13 @@ on: jobs: Jazzy: - runs-on: macos-13 + runs-on: macos-15 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 - bundler-cache: true # runs 'bundle install' and caches installed gems automatically + ruby-version: '3.3' + bundler-cache: true - run: swift build - name: Generate documentation json run: swift run sourcekitten doc --spm --module-name SourceKittenFramework > SourceKittenFramework.json diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 246c130e6..83aff3e7b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,7 @@ All changes should be made via pull requests on GitHub. When issuing a pull request, please add a summary of your changes to the `CHANGELOG.md` file. -We follow the same syntax as [CocoaPods' `CHANGELOG.md`](https://github.com/CocoaPods/CocoaPods/blob/master/CHANGELOG.md): +We follow this syntax for the changelog: 1. One Markdown unnumbered list item describing the change. 2. 2 trailing spaces on the last line describing the change. diff --git a/Gemfile b/Gemfile index fb8bd6057..ea63b3ea6 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,3 @@ source 'https://rubygems.org' -gem 'cocoapods' gem "jazzy" diff --git a/Gemfile.lock b/Gemfile.lock index 35785272b..e7d421355 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,33 +1,33 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.7) - base64 - nkf - rexml - activesupport (7.1.3.2) + CFPropertyList (3.0.8) + activesupport (7.2.3.1) base64 + benchmark (>= 0.3) bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) - minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) + logger (>= 1.4.2) + minitest (>= 5.1, < 6) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + addressable (2.8.9) + public_suffix (>= 2.0.2, < 8.0) algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) atomos (0.1.3) - base64 (0.2.0) - bigdecimal (3.1.6) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (4.1.0) claide (1.1.0) - cocoapods (1.15.2) + cocoapods (1.16.2) addressable (~> 2.8) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.15.2) + cocoapods-core (= 1.16.2) cocoapods-deintegrate (>= 1.0.3, < 2.0) cocoapods-downloader (>= 2.1, < 3.0) cocoapods-plugins (>= 1.0.0, < 2.0) @@ -41,8 +41,8 @@ GEM molinillo (~> 0.8.0) nap (~> 1.0) ruby-macho (>= 2.3.0, < 3.0) - xcodeproj (>= 1.23.0, < 2.0) - cocoapods-core (1.15.2) + xcodeproj (>= 1.27.0, < 2.0) + cocoapods-core (1.16.2) activesupport (>= 5.0, < 8) addressable (~> 2.8) algoliasearch (~> 1.0) @@ -62,72 +62,76 @@ GEM netrc (~> 0.11) cocoapods-try (1.2.0) colored2 (3.1.2) - concurrent-ruby (1.2.3) - connection_pool (2.4.1) - drb (2.2.0) - ruby2_keywords + concurrent-ruby (1.3.6) + connection_pool (3.0.2) + drb (2.2.3) escape (0.0.4) - ethon (0.16.0) + ethon (0.18.0) ffi (>= 1.15.0) - ffi (1.16.3) + logger + ffi (1.17.4) + ffi (1.17.4-arm64-darwin) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) - httpclient (2.8.3) - i18n (1.14.1) + httpclient (2.9.0) + mutex_m + i18n (1.14.8) concurrent-ruby (~> 1.0) - jazzy (0.14.4) + jazzy (0.15.4) + activesupport (>= 5.0, < 8) cocoapods (~> 1.5) + logger mustache (~> 1.1) open4 (~> 1.3) redcarpet (~> 3.4) - rexml (~> 3.2) + rexml (>= 3.2.7, < 4.0) rouge (>= 2.0.6, < 5.0) sassc (~> 2.1) sqlite3 (~> 1.3) xcinvoke (~> 0.3.0) - json (2.7.1) + json (2.19.3) liferaft (0.0.6) - mini_portile2 (2.8.5) - minitest (5.22.2) + logger (1.7.0) + mini_portile2 (2.8.9) + minitest (5.27.0) molinillo (0.8.0) - mustache (1.1.1) - mutex_m (0.2.0) - nanaimo (0.3.0) + mustache (1.1.2) + mutex_m (0.3.0) + nanaimo (0.4.0) nap (1.1.0) netrc (0.11.0) - nkf (0.2.0) open4 (1.3.4) public_suffix (4.0.7) - redcarpet (3.6.0) - rexml (3.3.9) - rouge (4.2.0) + redcarpet (3.6.1) + rexml (3.4.4) + rouge (4.7.0) ruby-macho (2.5.1) - ruby2_keywords (0.0.5) sassc (2.4.0) ffi (~> 1.9) - sqlite3 (1.7.2) + securerandom (0.4.1) + sqlite3 (1.7.3) mini_portile2 (~> 2.8.0) - typhoeus (1.4.1) - ethon (>= 0.9.0) + typhoeus (1.6.0) + ethon (>= 0.18.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) xcinvoke (0.3.0) liferaft (~> 0.0.6) - xcodeproj (1.25.0) + xcodeproj (1.27.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) - nanaimo (~> 0.3.0) - rexml (>= 3.3.2, < 4.0) + nanaimo (~> 0.4.0) + rexml (>= 3.3.6, < 4.0) PLATFORMS + arm64-darwin-25 ruby DEPENDENCIES - cocoapods jazzy BUNDLED WITH - 2.3.8 + 2.7.2 diff --git a/Makefile b/Makefile index 4156a0b81..f73223fbb 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ SOURCEKITTENFRAMEWORK_PLIST=Source/SourceKittenFramework/Info.plist VERSION_STRING="$(shell ./script/get-version)" -.PHONY: all clean install package test uninstall +.PHONY: all clean install package test uninstall release all: build @@ -50,7 +50,9 @@ uninstall: rm -rf "$(FRAMEWORKS_FOLDER)/SourceKittenFramework.framework" rm -f "$(BINARIES_FOLDER)/sourcekitten" -installables: clean build +installables: build + rm -f "$(OUTPUT_PACKAGE)" + rm -rf "$(TEMPORARY_FOLDER)" install -d "$(TEMPORARY_FOLDER)$(BINARIES_FOLDER)" install "$(SOURCEKITTEN_EXECUTABLE)" "$(TEMPORARY_FOLDER)$(BINARIES_FOLDER)" @@ -66,7 +68,40 @@ package: installables --version "$(VERSION_STRING)" \ "$(OUTPUT_PACKAGE)" -release: package +release: + $(eval ARGS := $(filter-out $@,$(MAKECMDGOALS))) + $(eval VERSION := $(word 1,$(ARGS))) + $(eval RELEASE_NAME := $(wordlist 2,100,$(ARGS))) + @if [ -z "$(VERSION)" ] || [ -z "$(RELEASE_NAME)" ]; then \ + echo "usage: make release "; \ + exit 1; \ + fi + @# Set version + @sed -i '' 's/## Main/## $(VERSION)/g' CHANGELOG.md + @sed 's/__VERSION__/$(VERSION)/g' script/Version.swift.template > Source/SourceKittenFramework/Version.swift + @sed -e '3s/.*/ version = "$(VERSION)",/' -i '' MODULE.bazel + @# Commit, tag, push + git commit -am "Release $(VERSION)" + git tag -a "$(VERSION)" -m "$(VERSION): $(RELEASE_NAME)" + git push origin main + git push origin "$(VERSION)" + @# Build pkg + $(MAKE) package + @# Download source tarball for BCR stable URL + curl -fsSL --retry 5 "https://github.com/jpsim/SourceKitten/archive/refs/tags/$(VERSION).tar.gz" \ + -o "SourceKitten-$(VERSION).tar.gz" + @# Create GitHub release + gh release create "$(VERSION)" \ + "$(OUTPUT_PACKAGE)" \ + "SourceKitten-$(VERSION).tar.gz" \ + --title "$(VERSION): $(RELEASE_NAME)" \ + --notes "$$(sed -n '/^## $(VERSION)/,/^## /{/^## $(VERSION)/d;/^## /d;p;}' CHANGELOG.md)" + rm -f "SourceKitten-$(VERSION).tar.gz" + @# Add empty changelog section + @printf '## Main\n\n#### Breaking\n\n* None.\n\n#### Enhancements\n\n* None.\n\n#### Bug Fixes\n\n* None.\n\n' | cat - CHANGELOG.md > /tmp/CHANGELOG.md.tmp + @mv /tmp/CHANGELOG.md.tmp CHANGELOG.md + git commit -am "Add empty changelog section" + git push origin main docker_test: docker run -v `pwd`:`pwd` -w `pwd` --name sourcekitten --rm swift:5.10-focal swift test --parallel @@ -78,10 +113,6 @@ docker_htop: display_compilation_time: $(BUILD_TOOL) $(XCODEFLAGS) OTHER_SWIFT_FLAGS="-Xfrontend -debug-time-function-bodies" clean build-for-testing | grep -E ^[1-9]{1}[0-9]*.[0-9]+ms | sort -n -publish: - brew update && brew bump-formula-pr --tag=$(shell git describe --tags) --revision=$(shell git rev-parse HEAD) sourcekitten - pod trunk push --verbose - update_clang_headers: rm -rf Source/Clang_C/include svn export http://llvm.org/svn/llvm-project/cfe/trunk/include/clang-c @@ -107,11 +138,6 @@ update_fixtures_docker: get_version: @echo $(VERSION_STRING) -set_version: - $(eval NEW_VERSION := $(filter-out $@,$(MAKECMDGOALS))) - @sed -i '' 's/## Main/## $(NEW_VERSION)/g' CHANGELOG.md - @sed 's/__VERSION__/$(NEW_VERSION)/g' script/Version.swift.template > Source/SourceKittenFramework/Version.swift - @sed -e '3s/.*/ version = "$(NEW_VERSION)",/' -i '' MODULE.bazel %: @: diff --git a/Releasing.md b/Releasing.md index dc7be15b5..fe0dc88a4 100644 --- a/Releasing.md +++ b/Releasing.md @@ -2,22 +2,29 @@ For SourceKitten contributors, follow these steps to cut a release: -1. Update version number: `make set_version 0.6.2` -2. Come up with a witty feline themed release name. Past names include: +1. Come up with a witty feline themed release name. Past names include: * Objective-Cat * Cat-astrophic * SourceClangKitLibKitten * Grumpy Cat -3. Commit & push to the `main` branch. -4. Tag: `git tag -a 0.6.2 -m "0.6.2: Objective-Cat"; git push origin 0.6.2` -5. Make sure you have the latest stable Xcode version installed and + * Yarn Ball +2. Make sure you have the latest stable Xcode version installed and `xcode-select`ed. -6. Create the pkg installer: `make release` -7. Create a GitHub release: https://github.com/jpsim/SourceKitten/releases/new - * Specify the tag you just pushed from the dropdown. - * Set the release title to the new version number & release name. - * Add the changelog section to the release description text box. - * Upload the pkg installer you just built to the GitHub - release binaries. - * Click "Publish release". -8. Publish to Homebrew and CocoaPods trunk: `make publish` +3. Run `make release `, e.g.: + ``` + make release 0.37.3 Yarn Ball + ``` + This will: + * Update the version in `CHANGELOG.md`, `Version.swift`, and + `MODULE.bazel`. + * Commit and push to `main`. + * Create and push an annotated tag. + * Build the pkg installer. + * Download the source tarball and upload it as a release asset + (required by the Bazel Central Registry for a stable URL). + * Create the GitHub release with the changelog, pkg, and source + tarball attached. + * Add an empty changelog section and push to `main`. +4. Homebrew will be updated automatically by BrewTestBot within ~3 + hours. The BCR GitHub app will open a PR to update the Bazel + Central Registry. diff --git a/SourceKittenFramework.podspec b/SourceKittenFramework.podspec deleted file mode 100644 index b6632ac48..000000000 --- a/SourceKittenFramework.podspec +++ /dev/null @@ -1,15 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'SourceKittenFramework' - s.version = `make get_version` - s.summary = 'An adorable little framework for interacting with SourceKit.' - s.homepage = 'https://github.com/jpsim/SourceKitten' - s.source = { git: s.homepage + '.git', tag: s.version } - s.license = { type: 'MIT', file: 'LICENSE' } - s.author = { 'JP Simard' => 'jp@jpsim.com' } - s.platform = :osx, '12' - s.source_files = 'Source/Clang_C/include/*.h', 'Source/SourceKit/include/*.h', 'Source/SourceKittenFramework/*.swift' - s.swift_versions = ['5.3', '5.4', '5.5', '5.6', '5.7'] - s.pod_target_xcconfig = { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' } - s.dependency 'SWXMLHash', '~> 7.0.0' - s.dependency 'Yams', '~> 5.0.0' -end