PyPI Release #31
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
name: PyPI Release | |
on: | |
create: | |
tags: | |
- v* | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create Release for new Tag | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
title: ${{ secrets.REPO_NAME }} ${{ github.event.ref }} | |
repo_token: ${{ secrets.PAT }} | |
prerelease: false | |
- name: Check Out Repo | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel twine | |
pip install --no-cache-dir --upgrade --requirement requirements.txt | |
- name: Build and publish | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: | | |
python setup.py sdist bdist_wheel | |
twine upload dist/* | |
- name: Discord Success Notification | |
uses: Kometa-Team/discord-notifications@master | |
if: success() | |
with: | |
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }} | |
title: "${{ secrets.REPO_NAME }} ${{ github.event.ref }}: **Build Successful**" | |
url: https://github.com/Kometa-Team/${{ secrets.REPO_NAME }}/actions/runs/${{ github.run_id }} | |
color: 844716 | |
username: Kobota | |
avatar_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/logo.png | |
author: PyPI | |
author_icon_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/pypi.svg | |
- name: Discord Failure Notification | |
uses: Kometa-Team/discord-notifications@master | |
if: failure() | |
with: | |
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }} | |
message: <@&1079153184007790652> | |
title: "${{ secrets.REPO_NAME }} ${{ github.event.ref }}: **Build Failed**" | |
url: https://github.com/Kometa-Team/${{ secrets.REPO_NAME }}/actions/runs/${{ github.run_id }} | |
color: 14879811 | |
username: Kobota | |
avatar_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/logo.png | |
author: PyPI | |
author_icon_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/pypi.svg |