Skip to content

Merge pull request #195 from finmars-platform/celery_settings #120

Merge pull request #195 from finmars-platform/celery_settings

Merge pull request #195 from finmars-platform/celery_settings #120

Workflow file for this run

name: CI Versioning & Build
on:
push:
branches:
- main
permissions:
contents: write
jobs:
lint:
name: Lint Python Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install linters
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Ruff (format check)
run: ruff format --check
- name: Run Ruff (lint + auto-fix)
run: ruff check
test:
uses: ./.github/workflows/tests.yml
versioning:
name: Bump Patch Version
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- uses: actions/checkout@v4
- name: Fetch tags
run: git fetch --tags
- name: Get latest version
id: get_tag
run: |
latest_tag=$(git tag --sort=-v:refname | head -n1)
echo "Latest tag: $latest_tag"
echo "latest_tag=$latest_tag" >> $GITHUB_OUTPUT
- name: Calculate new patch version
id: bump_patch
run: |
latest_tag=${{ steps.get_tag.outputs.latest_tag }}
IFS='-' read -r version suffix <<< "$latest_tag"
IFS='.' read -r major minor patch <<< "${version}"
patch=$((patch + 1))
new_version="$major.$minor.$patch-rc"
echo "new_version=$new_version" >> $GITHUB_OUTPUT
- name: Create tag
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git tag ${{ steps.bump_patch.outputs.new_version }}
git push origin ${{ steps.bump_patch.outputs.new_version }}
outputs:
new_version: ${{ steps.bump_patch.outputs.new_version }}
release:
needs: versioning
uses: ./.github/workflows/docker.yml
with:
version: ${{ needs.versioning.outputs.new_version }}
secrets:
CI_REGISTRY_USER: ${{ secrets.CI_REGISTRY_USER }}
CI_REGISTRY_PASSWORD: ${{ secrets.CI_REGISTRY_PASSWORD }}
CI_REGISTRY_IMAGE: ${{ secrets.CI_REGISTRY_IMAGE }}
publish:
needs: [release, versioning]
uses: ./.github/workflows/publish_version.yml
with:
version: ${{ needs.versioning.outputs.new_version }}