Implement latest_by_nvr #9
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: Upload Package to PyPI and TestPyPI | |
on: | |
push: | |
branches: [ master ] | |
tags: | |
- '*' | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Setup System Dependencies | |
run: | | |
sudo apt update | |
sudo apt install libkrb5-dev -y | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r dist-requirements.txt | |
- name: Create Environment Variable For Test PyPI Builds | |
if: startsWith(github.ref, 'refs/tags/') != true | |
shell: bash | |
run: | | |
echo 'SCM_NO_LOCAL_SCHEME=true' >> $GITHUB_ENV | |
- name: Check environment variable | |
run: echo "${{ env.SCM_NO_LOCAL_SCHEME}}" | |
- name: Build package | |
run: python -m build | |
- name: Publish to Test PyPI | |
if: startsWith(github.ref, 'refs/tags/') != true | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.TEST_PYPI_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} |