v0.1.2 #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will upload a Python Package using Twine when a release is created | |
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Publish autoplex | |
on: | |
release: | |
types: [published] | |
jobs: | |
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 | |
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 | |
deploy: | |
needs: update-changelog | |
runs-on: ubuntu-latest | |
steps: | |
- name: Pause for 5 minutes to merge update Changelog PR | |
run: | | |
echo "Wait for 5 minutes to merge PR..." | |
sleep 300 | |
echo "Resuming workflow..." | |
- 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 }} |