Fix shebang #3
This file contains hidden or 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
| name: Release Alfred Workflow | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get latest release version | |
| id: get_version | |
| run: | | |
| LATEST=$(gh release list --limit 1 --json tagName --jq '.[0].tagName // "1.0.0"' 2>/dev/null || echo "1.0.0") | |
| LATEST=${LATEST#v} | |
| if [ -z "$LATEST" ] || [ "$LATEST" = "null" ]; then | |
| LATEST="1.0.0" | |
| fi | |
| IFS='.' read -r MAJOR MINOR PATCH <<< "$LATEST" | |
| PATCH=$((PATCH + 1)) | |
| NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}" | |
| echo "latest=$LATEST" >> $GITHUB_OUTPUT | |
| echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT | |
| echo "Incrementing version: $LATEST -> $NEW_VERSION" | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: Update version in info.plist | |
| run: | | |
| sed -i 's|<key>version</key>\s*<string>[^<]*</string>|<key>version</key>\n\t<string>${{ steps.get_version.outputs.new_version }}</string>|' workflow/info.plist | |
| - name: Package workflow | |
| run: | | |
| cd workflow | |
| zip -r ../Better-Spelling.alfredworkflow . | |
| cd .. | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.get_version.outputs.new_version }} | |
| name: ${{ steps.get_version.outputs.new_version }} | |
| body: | | |
| Automated release ${{ steps.get_version.outputs.new_version }} | |
| Download `Better-Spelling.alfredworkflow` and double-click to install. | |
| files: Better-Spelling.alfredworkflow | |
| generate_release_notes: true |