Update publish-cli.yml #4
Workflow file for this run
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
name: Build and Release AI CLI | |
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version number (e.g., 1.0.0)' | |
required: false | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
pip install pyinstaller music_tag jibrish_to_hebrew chardet spacy==3.7.5 scikit-learn==1.5.1 | |
- name: Build EXE | |
run: | | |
pyinstaller --onefile --add-data "src/core/app/singer-list.csv;app" --name "Singles-Sorter" --icon "src/core/assets/icon.ico" "src/core/singles_sorter_v5.py" | |
- name: Get the version | |
id: get_version | |
shell: bash | |
run: | | |
if [ -n "${{ github.event.inputs.version }}" ]; then | |
VERSION="${{ github.event.inputs.version }}" | |
# הסרת "v" מהתחלה אם קיים | |
VERSION="${VERSION#v}" | |
elif [[ "${GITHUB_REF}" =~ ^refs/tags/v(.+)$ ]]; then | |
VERSION="${BASH_REMATCH[1]}" | |
else | |
echo "No version specified and could not extract version from tag." | |
exit 1 | |
fi | |
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
echo "RELEASE_TITLE=מסדר הסינגלים $VERSION" >> $GITHUB_OUTPUT | |
- name: Rename output file | |
shell: pwsh | |
run: | | |
$version = "${{ steps.get_version.outputs.VERSION }}" | |
Move-Item -Path "dist\Singles-Sorter.exe" -Destination "dist\singles-sorter-cli-ai-$version.exe" | |
- name: Create Release | |
uses: softprops/action-gh-release@v2.0.6 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ steps.get_version.outputs.VERSION }} | |
name: ${{ steps.get_version.outputs.RELEASE_TITLE }} | |
draft: true | |
prerelease: true | |
files: ./dist/singles-sorter-cli-ai-${{ steps.get_version.outputs.VERSION }}.exe |