2024-06-22 01:39:38 -04:00
|
|
|
name: Actions
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
|
|
|
|
jobs:
|
2024-11-14 12:26:33 -05:00
|
|
|
build:
|
|
|
|
name: Build Package
|
2024-06-22 01:39:38 -04:00
|
|
|
runs-on: docker
|
2024-11-14 12:26:33 -05:00
|
|
|
container: www.coastalcommits.com/cswimr/actions:uv
|
2024-06-22 01:39:38 -04:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Install dependencies
|
2024-11-14 12:26:33 -05:00
|
|
|
run: uv sync --color=always
|
2024-06-22 01:39:38 -04:00
|
|
|
|
|
|
|
- name: Build the package
|
2024-11-14 12:26:33 -05:00
|
|
|
run: uv build --color=always
|
2024-06-22 01:39:38 -04:00
|
|
|
|
|
|
|
- name: Upload the package
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: stellarismodparser
|
|
|
|
path: ./dist/*
|
|
|
|
|
2024-06-22 01:48:30 -04:00
|
|
|
- name: Publish to CoastalCommits
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
uses: actions/pypi-publish@v1.8.14
|
|
|
|
with:
|
2024-06-22 01:50:04 -04:00
|
|
|
username: ${{ github.repository_owner }}
|
2024-06-22 01:48:30 -04:00
|
|
|
password: ${{ secrets.COASTALCOMMITSTOKEN }}
|
|
|
|
repository_url: https://www.coastalcommits.com/api/packages/${{ github.repository_owner }}/pypi
|
|
|
|
|
2024-06-22 01:39:38 -04:00
|
|
|
- name: Publish to PyPi
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
uses: actions/pypi-publish@v1.8.14
|
|
|
|
with:
|
|
|
|
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
|
|
|
2024-11-14 12:26:33 -05:00
|
|
|
lint:
|
|
|
|
name: Lint Code (Ruff & Pylint)
|
2024-06-22 01:39:38 -04:00
|
|
|
runs-on: docker
|
2024-11-14 12:26:33 -05:00
|
|
|
container: www.coastalcommits.com/cswimr/actions:uv
|
2024-06-22 01:39:38 -04:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Install dependencies
|
2024-11-14 12:26:33 -05:00
|
|
|
run: uv build --color=always
|
2024-06-22 01:39:38 -04:00
|
|
|
|
|
|
|
- name: Analysing code with Ruff
|
2024-11-14 12:26:33 -05:00
|
|
|
run: uv run --color=always ruff check $(git ls-files '*.py')
|
2024-06-22 01:39:38 -04:00
|
|
|
continue-on-error: true
|
|
|
|
|
|
|
|
- name: Analysing code with Pylint
|
2024-11-14 12:26:33 -05:00
|
|
|
run: uv run --color=always pylint --rcfile=.forgejo/workflows/config/.pylintrc $(git ls-files '*.py')
|