Skip to content

Commit

Permalink
👷 Add auto-release to upload .exe file
Browse files Browse the repository at this point in the history
  • Loading branch information
NTGNguyen committed Sep 10, 2024
1 parent 6cf83d5 commit 4977df4
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ jobs:
uses: actions/checkout@v2

- name: Install dependencies
run: sudo apt-get install -y jq
run: |
sudo apt-get update
sudo apt-get install -y jq
python -m pip install --upgrade pip
pip install pyinstaller
- name: Get version from pyproject.toml
id: get_version
Expand All @@ -30,6 +34,10 @@ jobs:
run: |
zip -r KMeans-KNN.zip .
- name: Create .exe file
run: |
pyinstaller --onefile main.py
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
Expand All @@ -53,3 +61,13 @@ jobs:
asset_path: ./KMeans-KNN.zip
asset_name: KMeans-KNN.zip
asset_content_type: application/zip

- name: Upload Executable
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./main
asset_name: KMeans-KNN_${{ steps.get_version.outputs.version }}.exe
asset_content_type: application/octet-stream

0 comments on commit 4977df4

Please sign in to comment.