support-organizer/.forgejo/workflows/build_release.yml

64 lines
2 KiB
YAML
Raw Normal View History

2023-12-20 16:04:31 +00:00
on:
push:
2023-12-21 16:22:13 +00:00
tags:
- '[0-9]+\.[0-9]+\.[0-9]+pre[0-9]+'
- '[0-9]+\.[0-9]+\.[0-9]+rc[0-9]+'
- '[0-9]+\.[0-9]+\.[0-9]+a[0-9]+'
- '[0-9]+\.[0-9]+\.[0-9]+b[0-9]+'
- '[0-9]+\.[0-9]+\.[0-9]'
2023-12-20 16:04:31 +00:00
jobs:
backend-pylint:
runs-on: docker
2023-12-20 16:15:12 +00:00
container: nikolaik/python-nodejs:python3.11-nodejs21
2023-12-20 16:04:31 +00:00
steps:
2023-12-20 16:08:26 +00:00
- name: Checkout source code
uses: https://code.forgejo.org/actions/checkout@v3
2023-12-20 16:04:31 +00:00
- name: Install packages
2023-12-20 16:25:33 +00:00
working-directory: ./backend
2023-12-20 16:04:31 +00:00
run: |
pip install -e . -q
python -m pip list --format=columns --disable-pip-version-check
pip install pylint~=2.17.7 --disable-pip-version-check -q
- name: Run pylint
2023-12-20 16:25:33 +00:00
working-directory: ./backend
2023-12-20 16:04:31 +00:00
run: |
pylint --version
pylint **/*.py --exit-zero
2023-12-21 16:22:13 +00:00
build-artifacts:
2023-12-20 16:04:31 +00:00
needs: ["backend-pylint"]
runs-on: docker
2023-12-20 16:15:12 +00:00
container: nikolaik/python-nodejs:python3.11-nodejs21
2023-12-20 16:04:31 +00:00
steps:
2023-12-20 16:08:26 +00:00
- name: Checkout source code
uses: https://code.forgejo.org/actions/checkout@v3
2023-12-20 16:04:31 +00:00
- name: Install packages
2023-12-20 16:25:33 +00:00
working-directory: ./backend
2023-12-20 16:04:31 +00:00
run: pip install build
- name: Build package
2023-12-20 16:25:33 +00:00
working-directory: ./backend
2023-12-20 16:04:31 +00:00
run: |
python -m build
cp dist ../dist -r
- name: Save build artifacts
uses: https://code.forgejo.org/actions/upload-artifact@v3
with:
name: packages
path: dist/*
2023-12-21 16:24:21 +00:00
2023-12-21 16:22:13 +00:00
publish-artifacts:
needs: ["build-artifacts"]
runs-on: docker
container: nikolaik/python-nodejs:python3.11-nodejs21
steps:
- name: Downloading static site artifacts
uses: actions/download-artifact@v3
with:
name: packages
path: dist
- name: Install Dependencies
run: pip install twine
- name: Upload package to registry
2023-12-21 16:24:21 +00:00
run: python -m twine upload --repository-url ${{ secrets.REPOSITORY_URL }} -u ${{ secrets.TWINE_DEPLOY_USER }} -p ${{ secrets.TWINE_DEPLOY_PASSWORD }} dist/*