forked from autoatml/autoplex
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d08e9be
commit 8167348
Showing
1 changed file
with
17 additions
and
49 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 }} |