35 lines
863 B
YAML
35 lines
863 B
YAML
when:
|
|
event: [push, tag, pull_request]
|
|
|
|
steps:
|
|
lint:
|
|
image: python:3.12-alpine
|
|
commands:
|
|
# Install Ruff for linting
|
|
- pip install --no-cache-dir ruff
|
|
# Check syntax and undefined names/variables across your Python files
|
|
- ruff check .
|
|
# Check formatting compliance
|
|
- ruff format --check .
|
|
|
|
package:
|
|
image: alpine:latest
|
|
commands:
|
|
- mkdir -p dist
|
|
# Tar up Python files and example configs into a versioned archive
|
|
- tar -czf dist/pico-time-${CI_COMMIT_TAG:-dev}.tar.gz *.py pyproject.toml README.md
|
|
when:
|
|
event: tag
|
|
|
|
gitea_release:
|
|
image: plugins/gitea-release
|
|
settings:
|
|
api_key:
|
|
from_secret: gitea_api_key
|
|
base_url: https://git.metaunix.net
|
|
title: "${CI_COMMIT_TAG}"
|
|
files:
|
|
- dist/pico-time-*.tar.gz
|
|
when:
|
|
event: tag
|