Skip to content

Commit

Permalink
👷 Add auto update release
Browse files Browse the repository at this point in the history
  • Loading branch information
NTGNguyen committed Sep 8, 2024
1 parent d999b40 commit 1beb076
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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 install -y jq

- 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 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

0 comments on commit 1beb076

Please sign in to comment.