Skip to content

🔖 Bump version to 1.0.0 in pyproject.toml #5

🔖 Bump version to 1.0.0 in pyproject.toml

🔖 Bump version to 1.0.0 in pyproject.toml #5

Workflow file for this run

name: Create Release
on:
push:
tags:
- "release*"
jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install dependencies
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
run: |
VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' pyproject.toml)
echo "::set-output name=version::$VERSION"
- name: Create zip file
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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: "Release ${{ github.ref }}"
body: |
This release was automatically generated by a GitHub Action.
Version: ${{ steps.get_version.outputs.version }}
draft: false
prerelease: false
- name: Upload Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
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