skyeweave/.forgejo/workflows/build-release.yaml

72 lines
2.2 KiB
YAML
Raw Normal View History

2024-08-09 16:57:33 +00:00
on:
push:
tags:
- '[0-9]+\.[0-9]+\.[0-9]+-c\.[0-9]+'
- '[0-9]+\.[0-9]+\.[0-9]+-a\.[0-9]+'
- '[0-9]+\.[0-9]+\.[0-9]'
jobs:
lint-and-typing:
runs-on: docker
2024-10-04 19:07:26 +00:00
container: forgejo.neshweb.net/ci-docker-images/python-neshweb:3.11
2024-08-09 16:57:33 +00:00
steps:
- name: Checkout source code
uses: https://code.forgejo.org/actions/checkout@v3
- name: Install packages
run: |
2024-10-05 13:09:05 +00:00
pip install -e .[lint,typing] -q --disable-pip-version-check -q --no-cache-dir -q
2024-08-09 16:57:33 +00:00
python -m pip list --format=columns --disable-pip-version-check
- name: Run pylint
run: |
pylint --version
pylint **/*.py --exit-zero --rc-file pyproject.toml
- name: Run mypy
run: |
mypy --version
mypy .
build-artifacts:
needs: ["lint-and-typing"]
runs-on: docker
2024-10-04 19:07:26 +00:00
container: forgejo.neshweb.net/ci-docker-images/python-neshweb:3.11
2024-08-09 16:57:33 +00:00
steps:
- name: Checkout source code
uses: https://code.forgejo.org/actions/checkout@v3
- name: Install packages
2024-10-05 13:09:05 +00:00
run: pip install build --no-cache-dir -q
2024-08-09 16:57:33 +00:00
- name: Build package
run: python -m build
- name: Save build artifacts
uses: https://code.forgejo.org/actions/upload-artifact@v3
with:
name: packages
path: dist/*
publish-artifacts:
needs: ["build-artifacts"]
runs-on: docker
2024-10-04 19:07:26 +00:00
container: forgejo.neshweb.net/ci-docker-images/python-neshweb:3.11
2024-08-09 16:57:33 +00:00
steps:
- name: Downloading static site artifacts
uses: actions/download-artifact@v3
with:
name: packages
path: dist
- name: Install Dependencies
2024-10-05 13:09:05 +00:00
run: pip install twine --no-cache-dir -q
2024-08-09 16:57:33 +00:00
- name: Upload package to registry
run: python -m twine upload --repository-url ${{ secrets.REPOSITORY_URL }} -u ${{ secrets.TWINE_DEPLOY_USER }} -p ${{ secrets.TWINE_DEPLOY_PASSWORD }} dist/*
release:
2024-08-09 17:05:14 +00:00
needs: [ publish-artifacts ]
2024-08-09 16:57:33 +00:00
if: success()
runs-on: docker
steps:
- name: Release New Version
uses: actions/forgejo-release@v2
with:
direction: upload
url: https://forgejo.neshweb.net
release-dir: release
token: ${{ secrets.FORGEJO_TOKEN }}
tag: ${{ github.ref_name }}