Skip to content

production

production #1313

Workflow file for this run

name: Build and release to PyPI
on: ['deployment']
permissions: {}
jobs:
release:
permissions:
contents: write # for git push
deployments: write # to create a deployment status
runs-on: ubuntu-latest
env:
PYTHON_VERSION: "3.11"
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
with:
token: ${{ secrets.flexgetbot_pat }}
fetch-depth: 0
- name: Setup Git User
run: |
git config user.email ${{ secrets.git_email }}
git config user.name ${{ secrets.git_user }}
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
cache-dependency-path: 'dev-requirements.txt'
- name: Install dev dependencies
run: |
pip install -r requirements-release.txt
- name: Set Deployment Status Pending
uses: justacodename/deployment-status@v2
with:
state: pending
- name: Run release script
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.pypi_token }}
run: |
./release.sh
- name: Build Changelog
id: changelog
if: env.release_tag
run: |
echo 'CHANGELOG_BODY<<EOF' >> $GITHUB_ENV
python dev_tools.py get-changelog ${{ env.release_tag }} >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Create GitHub Release
uses: ncipollo/release-action@v1
if: env.release_tag
with:
tag: ${{ env.release_tag }}
artifacts: "dist/*"
token: ${{ secrets.GITHUB_TOKEN }}
body: ${{ env.CHANGELOG_BODY }}
- name: Set Deployment Status Success
uses: justacodename/deployment-status@v2
with:
state: success
- name: Set Deployment Status Failure
if: failure() || cancelled()
uses: justacodename/deployment-status@v2
with:
state: failure