template: markdown,git,project project: searchlink readme: src/_README.md download_title: SearchLink download_url: https://github.com/ttscoff/searchlink/releases/latest/download/SearchLink.zip
I'm doing everything on main and tagging releases. If you feel like creating a feature branch, just create a branch off of main and merge it back in after testing.
Tag releases with gh release create --title TITLE -n "NOTE"
. Run git pull
afterward to add the tag locally. Upload zip files to the new release with gh release upload TAG FILE.zip
. This is handled by the Finalize Deploy topic.
Main source is in bin/searchlink
, with the code split between files in lib
(gem configuration).
Before deploying, run compile.rb
to gather all sources into a single file for use in the Services. (This is handled by the Prepare Deploy topic.)
@run(subl -p searchlink.sublime-project)
This topic will pass its arguments to the searchlink executable. To run spec tests, use rake test
.
#!/bin/bash
echo $* | bundle exec bin/searchlink
@run(rake spec)
To run as a Service, the script needs to be compiled into a single, long script. Import statements in the source that are preceded by #import
will be combined by the compile.rb script.
@run(./compile.rb) Compile a single script from library
@include(Compile Script) @run(cat searchlink.rb|pbcopy) Copy searchlink.rb to clipboard
@include(Clip Copy of Script)
open -a Automator ~/Library/Services/SearchLink\ File.workflow
open -a Automator ~/Library/Services/SearchLink.workflow
#!/usr/bin/env ruby
puts `changelog -u`
version = `rake sver`.strip
`git commit -a -m "#{version} version bump"`
`git pull`
`git push`
status = `changelog > current_changes.md; echo $?`
if status.to_i == 0
puts `gh release create #{version} -t "v#{version}" -F current_changes.md`
`git pull`
end
# Push a gem
`rake clobber package`
`gem push pkg/searchlink-#{version}.gem`
new_ver = `rake bump[patch]`
puts `git commit -a -m "Version bump #{new_ver}"`
#!/usr/bin/env ruby
require 'fileutils'
version = `git ver`.strip
zipball = "dist/SearchLink.zip"
FileUtils.rm(zipball) if File.exist?(zipball)
puts "Creating #{zipball}"
`zip -r "#{zipball}" "SearchLink Services/"*`
puts `gh release upload #{version} #{zipball}`
@include(open automator services) @run(changelog -u)
#!/bin/bash
version=$(rake sver)
git commit -a -m "Preparing for $version release"
git pull
git push
@before
- Update Changelog
- Open Searchlink and SearchLink File in Automator (bld auto)
- Paste in current contents of searchlink.rb
- File->Export and save CodeSigned workflows to /SearchLink Services
- Git commit and push
All of this can be done with bld prepare
and bld stage
@end
- Compress 3 services to SearchLink.zip
- Create a git release for X.X.X
- Upload zip to release
- Update blog project and downloads
#!/usr/bin/env ruby
result = true
['SearchLink.workflow', 'SearchLink File.workflow', 'Jump to SearchLink Error.workflow'].each { |f| result = false unless File.exist?(File.join('SearchLink Services', f)) }
raise "Missing one or more Services" unless result
@include(Create Release) @include(Upload Zip) @include(Update Blog Project) @include(Update Download)
@after Don't forget to deploy the blog with the new readme/changelog. @end