Skip to content

Commit

Permalink
workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jm-rivera committed Nov 10, 2024
1 parent bc0f3a5 commit 5f429c8
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/draft_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Draft Release

on:
push:
tags:
- 'v*'
workflow_dispatch:

jobs:

release:
name: Create Release
runs-on: ubuntu-latest

strategy:
matrix:
python-versions: [ "3.10" ]

steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-versions }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry git-changelog
poetry install
- name: Build the package
run: poetry run poetry build

- name: Generate changelog
run: poetry run git-changelog > CHANGELOG.md

- name: Create Draft GitHub Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: dist/*.whl
draft: true # Set to true to make it a draft release
prerelease: false
body_path: CHANGELOG.md # Automatically include changelog
39 changes: 39 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish to PyPI

on:
workflow_dispatch:

jobs:
publish:
name: Publish to PyPI
runs-on: ubuntu-latest

strategy:
matrix:
python-versions: ["3.10"]

steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-versions }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Build the package
run: poetry build

- name: Publish to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
verify_metadata: true

0 comments on commit 5f429c8

Please sign in to comment.