Skip to content

Commit

Permalink
Create package.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
research11111 authored Oct 15, 2023
1 parent fb12718 commit 1e041f8
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build and Release Python Wheel with Poetry

on:
push:
branches: [ main ]
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11 # or the version you need

- name: Install Poetry
run: pip install poetry

- name: Install dependencies
run: poetry install

- name: Build wheel
run: poetry build

- name: Find package
id: find_pkg
run: |
package_file=$(ls dist/*.whl)
echo "package_file=${package_file}" >> $GITHUB_ENV
echo "tag_name=$(echo $GITHUB_REF | sed 's|refs/tags/||')" >> $GITHUB_ENV
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: python_wheel
path: ${{ env.package_file }}
retention-days: 1

- name: Move to release
id: upload-artifact
uses: softprops/action-gh-release@v1
with:
files: ${{ env.package_file }}
tag_name: ${{ env.tag_name }}
name: Release ${{ env.tag_name }}
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: false

0 comments on commit 1e041f8

Please sign in to comment.