File tree Expand file tree Collapse file tree 3 files changed +38
-14
lines changed Expand file tree Collapse file tree 3 files changed +38
-14
lines changed Original file line number Diff line number Diff line change 11name : Release Alfred Workflow
22
33on :
4- push :
5- tags :
6- - ' v*' # Trigger on tags starting with 'v', e.g., v1.0.0
4+ workflow_dispatch :
5+ inputs :
6+ version :
7+ description : ' Version number (X.Y.Z)'
8+ required : true
9+ default : ' '
710
811jobs :
912 build :
@@ -26,14 +29,15 @@ jobs:
2629 - name : Build workflow
2730 run : |
2831 chmod +x build.sh
29- ./build.sh
32+ ./build.sh --version ${{ github.event.inputs.version }}
3033
3134 - name : Create Release
3235 id : create_release
3336 uses : softprops/action-gh-release@v1
3437 with :
3538 files : alfred-leetcode.alfredworkflow
36- name : Release ${{ github.ref_name }}
39+ name : Release ${{ github.event.inputs.version }}
40+ tag_name : v${{ github.event.inputs.version }}
3741 draft : false
3842 prerelease : false
3943 generate_release_notes : true
Original file line number Diff line number Diff line change @@ -44,9 +44,26 @@ To contribute to this project:
44441 . Clone the repository
45452 . Make your changes to ` alfred_leetcode.py `
46463 . Test locally with ` python3 cli.py [search term] `
47- 4 . Build the workflow with ` ./build.sh `
47+ 4 . Build the workflow with ` ./build.sh ` for local testing, or with a specific version for release
48485 . Submit a pull request
4949
50+ ### Building the Workflow
51+
52+ There are two ways to build the workflow:
53+
54+ ``` bash
55+ # For local development (uses version 1.0.0-dev)
56+ ./build.sh
57+
58+ # For releases with a specific version number
59+ ./build.sh --version 1.2.3
60+
61+ # Short form also works
62+ ./build.sh -v 1.2.3
63+ ```
64+
65+ This will create an ` alfred-leetcode.alfredworkflow ` file that can be installed in Alfred.
66+
5067## License
5168
5269MIT
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e
33
4- # Determine version - use GITHUB_REF_NAME in CI or hardcoded for local testing
5- if [ -n " $GITHUB_REF_NAME " ]; then
6- # In GitHub Actions, the ref name will be the tag (e.g., v1.2.0)
7- # Remove the 'v' prefix if present
8- VERSION=${GITHUB_REF_NAME# v}
9- echo " Building release version: $VERSION (from GitHub CI)"
4+ # Check for version argument
5+ if [ " $1 " == " --version" ] || [ " $1 " == " -v" ]; then
6+ if [ -z " $2 " ]; then
7+ echo " Error: Version argument is missing"
8+ echo " Usage: $0 --version VERSION"
9+ exit 1
10+ fi
11+ VERSION=" $2 "
12+ echo " Building release version: $VERSION (manually specified)"
1013else
11- # For local development/testing, use hardcoded version
14+ # For local development/testing, use default version
1215 VERSION=" 1.0.0-dev"
13- echo " Building test version: $VERSION (hardcoded for local development)"
16+ echo " Building test version: $VERSION (default for local development)"
1417fi
1518
1619# Output filename
You can’t perform that action at this time.
0 commit comments