Skip to content

Commit

Permalink
Update python-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
naik-aakash authored Feb 3, 2025
1 parent d08e9be commit 8167348
Showing 1 changed file with 17 additions and 49 deletions.
66 changes: 17 additions & 49 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,61 +6,29 @@
# separate terms of service, privacy policy, and support
# documentation.

name: Publish autoplex
name: Deploy Autoplex to PyPI
on:
workflow_dispatch:
release:
types: [published]
pull_request:
types: [closed]
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

if: github.event.pull_request.merged == true && github.event.pull_request.head.ref == 'update-changelog'
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install build
python -m build
- name: Publish package
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

update-changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Fetch Version Tag & Release Notes
id: get_release_info
run: |
echo "VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
echo "NOTES<<EOF" >> $GITHUB_ENV
gh release view ${{ github.event.release.tag_name }} --json body -q .body >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Insert Version Tag & Release Notes Below `# Changelog`
run: |
{ echo "# Changelog"; echo; echo "## $VERSION"; echo; echo "$NOTES"; echo; tail -n +2 CHANGELOG.md; } > temp.md && mv temp.md CHANGELOG.md
- name: Create Pull Request to push updated CHANGELOG.md
uses: peter-evans/create-pull-request@v7
- name: Publish package
uses: pypa/[email protected]
with:
#token: ${{ secrets.ACTION_SECRET }}
commit-message: update CHANGELOG
title: Update changelog with latest release notes
body: Update CHANGELOG.md to reflect release changes
branch: update-changelog
labels: |
automated pr
delete-branch: true
base: main
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 8167348

Please sign in to comment.