70 lines
1.7 KiB
YAML
70 lines
1.7 KiB
YAML
name: Actions
|
|
on:
|
|
push:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: docker
|
|
container: www.coastalcommits.com/cswimr/actions:uv
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
ref: ${{ github.ref }}
|
|
|
|
- name: Install python
|
|
run: uv python install 3.11
|
|
|
|
- name: Install dependencies
|
|
run: uv sync --no-dev
|
|
|
|
- name: Build the package
|
|
run: uv build
|
|
|
|
- name: Upload the package
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: seautils
|
|
path: ./dist/*
|
|
|
|
- name: Publish to CoastalCommits
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: actions/pypi-publish@v1.8.14
|
|
with:
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.COASTALCOMMITSTOKEN }}
|
|
repository_url: https://www.coastalcommits.com/api/packages/${{ github.repository_owner }}/pypi
|
|
|
|
- name: Publish to PyPi
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: actions/pypi-publish@v1.8.14
|
|
with:
|
|
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
|
|
lint:
|
|
name: Lint with Ruff & Pylint
|
|
runs-on: docker
|
|
container: www.coastalcommits.com/cswimr/actions:uv
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install python
|
|
run: uv python install 3.11
|
|
|
|
- name: Install dependencies
|
|
run: uv sync
|
|
|
|
- name: Analysing code with Ruff
|
|
run: uv run ruff check $(git ls-files '*.py')
|
|
continue-on-error: true
|
|
|
|
- name: Analysing code with Pylint
|
|
run: uv run pylint $(git ls-files '*.py')
|
|
continue-on-error: true
|