Release #32
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 | |
| on: workflow_dispatch | |
| permissions: | |
| contents: write | |
| actions: write | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| env: | |
| NEXT_VERSION: ${{ secrets.NEXT_VERSION }} | |
| PIP_LICENSES_LICENSE: ${{ secrets.PIP_LICENSES_LICENSE }} | |
| PYTHON_LICENSE: ${{ secrets.PYTHON_LICENSE }} | |
| PIP_LICENSE: ${{ secrets.PIP_LICENSE }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.13' | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| - name: Install pyinstaller | |
| run: pip install pyinstaller | |
| - name: Build project | |
| run: pyinstaller --onefile src/main.py --name llm-cli | |
| - name: Install pip-licenses | |
| run: pip install pip-licenses | |
| - name: Copy licenses | |
| run: | | |
| mkdir -p dist/licenses | |
| cp LICENSE dist/licenses/llm-cli_license.txt | |
| pip-licenses --format=plain-vertical --with-license-file --output-file=dist/licenses/dependencies_licenses.txt | |
| echo '${{ env.PIP_LICENSES_LICENSE }}' > dist/licenses/pip-licenses_license.txt | |
| echo '${{ env.PIP_LICENSE }}' > dist/licenses/pip_license.txt | |
| - name: Compress build | |
| if: success() | |
| run: | | |
| cd dist | |
| zip -r llm-cli-v${{ env.NEXT_VERSION }}_ubuntu.zip * | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: llm-cli-v${{ env.NEXT_VERSION }}_ubuntu | |
| path: dist/llm-cli-v${{ env.NEXT_VERSION }}_ubuntu.zip | |
| build-windows: | |
| runs-on: windows-latest | |
| env: | |
| NEXT_VERSION: ${{ secrets.NEXT_VERSION }} | |
| PIP_LICENSES_LICENSE: ${{ secrets.PIP_LICENSES_LICENSE }} | |
| PYTHON_LICENSE: ${{ secrets.PYTHON_LICENSE }} | |
| PIP_LICENSE: ${{ secrets.PIP_LICENSE }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.13' | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| - name: Install pyinstaller | |
| run: pip install pyinstaller | |
| - name: Build project | |
| run: pyinstaller --onefile src/main.py --name llm-cli | |
| - name: Install pip-licenses | |
| run: pip install pip-licenses | |
| - name: Copy licenses 1 | |
| run: | | |
| mkdir -p dist/licenses | |
| cp LICENSE dist/licenses/llm-cli_license.txt | |
| pip-licenses --format=plain-vertical --with-license-file --output-file=dist/licenses/dependencies_licenses.txt | |
| echo "${{ env.PIP_LICENSES_LICENSE }}" > dist/licenses/pip-licenses_license.txt | |
| echo "${{ env.PIP_LICENSE }}" > dist/licenses/pip_license.txt | |
| - name: Compress build | |
| if: success() | |
| run: | | |
| cd dist | |
| tar -cvf llm-cli-v${{ env.NEXT_VERSION }}_windows.zip * | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: llm-cli-v${{ env.NEXT_VERSION }}_windows | |
| path: dist/llm-cli-v${{ env.NEXT_VERSION }}_windows.zip | |
| release_github: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build-linux | |
| - build-windows | |
| env: | |
| NEXT_TAG: ${{ secrets.NEXT_VERSION }} | |
| NEXT_VERSION: ${{ secrets.NEXT_VERSION }} | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: llm-cli-v${{ env.NEXT_VERSION }}_ubuntu | |
| path: . | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: llm-cli-v${{ env.NEXT_VERSION }}_windows | |
| path: . | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| BODY: ${{ secrets.NEXT_RELEASE_DESCRIPTION }} | |
| with: | |
| tag_name: ${{ env.NEXT_TAG }} | |
| release_name: llm-cli-v${{ env.NEXT_VERSION }} | |
| body: ${{ env.BODY }} | |
| draft: false | |
| prerelease: false | |
| - name: Upload Release Asset (windows-latest) | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_name: llm-cli-v${{ env.NEXT_VERSION }}_windows.zip | |
| asset_path: llm-cli-v${{ env.NEXT_VERSION }}_windows.zip | |
| asset_content_type: application/zip | |
| - name: Upload Release Asset (ubuntu-latest) | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_name: llm-cli-v${{ env.NEXT_VERSION }}_ubuntu.zip | |
| asset_path: llm-cli-v${{ env.NEXT_VERSION }}_ubuntu.zip | |
| asset_content_type: application/zip |