All checks were successful
StarFields Django Rest Framework Generics / build (push) Successful in 11s
52 lines
1.9 KiB
YAML
52 lines
1.9 KiB
YAML
name: StarFields Django Rest Framework Generics
|
|
|
|
on: [push]
|
|
|
|
env:
|
|
GITHUB_WORKFLOW_REF:
|
|
TWINE_USERNAME: ${{ secrets.GIT_PYPI_USERNAME }}
|
|
TWINE_PASSWORD: ${{ secrets.GIT_PYPI_PASSWORD }}
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
# Bizzarre bug that needed the below according to https://forum.gitea.com/t/gitea-actions-with-python/7605/3
|
|
container: catthehacker/ubuntu:act-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
run: |
|
|
git clone https://${{secrets.GIT_USERNAME}}:${{secrets.GIT_PASSWORD_URLENCODED}}@git.starfieldsweb.com/StarFields/starfields-drf-generics ./
|
|
|
|
- name: Set up Python
|
|
# This is the version of the action for setting up Python, not the Python version.
|
|
uses: https://github.com/actions/setup-python@v5
|
|
with:
|
|
# Semantic version range syntax or exact version of a Python version
|
|
python-version: '3.12.3'
|
|
|
|
- name: Display Python version
|
|
run: python -c "import sys; print(sys.version)"
|
|
|
|
# TODO testing
|
|
# check https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#packaging-workflow-data-as-artifacts
|
|
|
|
- name: Build package
|
|
run: pip install build && python -m build
|
|
|
|
- name: Publish package to Gitea PyPI
|
|
run: pip install twine && pip install --upgrade pkginfo && python -m twine upload --repository-url https://git.starfieldsweb.com/api/packages/StarFields/pypi ./dist/*
|
|
|
|
# - name: Publish package to Gitea PyPI
|
|
# continue-on-error: false
|
|
# uses: pypa/gh-action-pypi-publish@release/v1
|
|
# with:
|
|
# user: ${{ secrets.GIT_PYPI_USERNAME }}
|
|
# password: ${{ secrets.GIT_PYPI_PASSWORD }}
|
|
# repository-url: https://git.starfieldsweb.com/api/packages/StarFields/pypi
|
|
# print-hash: true
|
|
# verbose: true
|
|
|
|
# TODO make a release section that creates a gitea release
|