chore(deps): update pre-commit hook alessandrojcm/commitlint-pre-comm… #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: [main] | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install poetry | |
run: pipx install poetry | |
- uses: actions/checkout@v3 | |
- uses: pre-commit/[email protected] | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Add relevant python context to test action. | |
run: | | |
mkdir xxx | |
touch xxx/__init__.py | |
echo 3.10.5 > .python-version | |
cat > pyproject.toml <<-EOF | |
[tool.poetry] | |
name = "xxx" | |
version = "0.1.0" | |
description = "test" | |
authors = ["XXX <[email protected]>"] | |
[tool.poetry.dependencies] | |
python = ">=3.10, <3.11" | |
pandas = "==1.5.2" | |
[build-system] | |
requires = ["poetry-core"] | |
build-backend = "poetry.core.masonry.api" | |
EOF | |
- name: Run actions-python/lint | |
uses: ./lint | |
with: | |
checkout-repo: false | |
- name: Check tools | |
shell: bash | |
run: | | |
#check that poetry exists and return error if not | |
if ! command -v poetry &> /dev/null | |
then | |
echo "poetry could not be found" | |
exit | |
fi | |
#check that python version is 3.10.5 and return error if not | |
if ! python --version | grep -q "3.10.5" | |
then | |
echo "python version is not 3.10.5" | |
exit 1 | |
fi | |
#check that pandas version is 1.5.2 and return error if not | |
if ! poetry show pandas | grep -q "1.5.2" | |
then | |
echo "pandas version is not 1.5.2" | |
exit 1 | |
fi | |
release: | |
name: Semantic Release | |
needs: [lint, test] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Semantic release | |
id: release | |
uses: cycjimmy/semantic-release-action@v3 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Major branch | |
if: steps.release.outputs.new_release_published == 'true' | |
shell: bash | |
run: | | |
echo "Updating branch: v${{ steps.release.outputs.new_release_major_version }}" | |
git branch -f v${{ steps.release.outputs.new_release_major_version }} | |
git push -f origin v${{ steps.release.outputs.new_release_major_version }} | |
publish-docs: | |
name: Publish docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- uses: actions/cache@v2 | |
with: | |
key: ${{ github.ref }} | |
path: .cache | |
- run: | | |
pip install mkdocs-material | |
- run: mkdocs gh-deploy --config-file docs/mkdocs.yaml --force |