-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7e232b1
Showing
9 changed files
with
1,388 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Release Alfred Workflow | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read # for checkout | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: macos-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "lts/*" | ||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: npx -p @semantic-release/git -p @semantic-release/github -p @semantic-release/exec semantic-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.DS_Store | ||
prefs.plist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"branches": ["main"], | ||
"plugins": [ | ||
["@semantic-release/commit-analyzer", { | ||
"preset": "angular", | ||
"releaseRules": [ | ||
{"release": "patch"} | ||
] | ||
}], | ||
"@semantic-release/release-notes-generator", | ||
["@semantic-release/exec", { | ||
"prepareCmd": "./.zip.sh ${nextRelease.version}" | ||
}], | ||
["@semantic-release/git", { | ||
"assets": ["info.plist"], | ||
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
}], | ||
["@semantic-release/github", { | ||
"assets": ["Reading-list.alfredworkflow"] | ||
}] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
# ----------------------- | ||
# new version number | ||
# ----------------------- | ||
|
||
# Prompt for version number, if not entered | ||
nextVersion="$*" | ||
currentVersion=$(plutil -extract 'version' raw -o - info.plist) | ||
echo "current version: $currentVersion" | ||
echo -n " next version: " | ||
if [[ -z "$nextVersion" ]]; then | ||
read -r nextVersion | ||
else | ||
echo "$nextVersion" | ||
fi | ||
|
||
# insert new version number | ||
plutil -replace version -string "$nextVersion" info.plist | ||
|
||
# ----------------------- | ||
# clean info.plist | ||
# ----------------------- | ||
|
||
# bkp info.plist | ||
cp -v info.plist info-original.plist | ||
|
||
# remove variables flagged as "no export" from info.plist | ||
if plutil -extract 'variablesdontexport' json -o - info.plist &>/dev/null; then | ||
excludedVars=$(plutil -extract variablesdontexport json -o - info.plist | tr -d "[]\"" | tr "," "\n") | ||
echo "$excludedVars" | tr "\n" "\0" | xargs -0 -I {} plutil -replace variables.{} -string "" info.plist | ||
|
||
exclusionNo=$(echo "$excludedVars" | wc -l | tr -d " ") | ||
echo "Removed $exclusionNo variables flagged as 'no export' removed from 'info.plist'." | ||
fi | ||
|
||
# ----------------------- | ||
# compile .alfredworkflow | ||
# ----------------------- | ||
|
||
# remove workflow file from previous release | ||
rm -fv ./*.alfredworkflow | ||
|
||
# zip | ||
workflowName=$(plutil -extract 'name' raw -o - info.plist | tr " " "-") | ||
# ".*" excludes the dotfiles (glob pattern, not regex) | ||
zip --quiet -r "$workflowName.alfredworkflow" . -x ".*" "doc*/*" "prefs.plist" "info-original.plist" "*.md" "*.alfredworkflow" "*.gif" | ||
echo "new $workflowName.alfredworkflow file created." | ||
|
||
# restore original | ||
rm -fv info.plist | ||
mv -fv info-original.plist info.plist | ||
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
![String Multitool](./icon.png) | ||
|
||
# Reading list | ||
|
||
[Alfred](https://www.alfredapp.com/) workflow helping you manage your links and quick search notes. | ||
|
||
## Usage | ||
Use keyword `string` (or custom keyword) to init String Multitool. Provide string as an argument and select needed transformation from list. |
Oops, something went wrong.