Compare commits

...

17 Commits

2 changed files with 23 additions and 17 deletions

View File

@@ -6,7 +6,6 @@ on:
- master - master
- dev - dev
paths-ignore: paths-ignore:
- "**/.github/**"
- "**/.gitignore" - "**/.gitignore"
- "**/.vscode/**" - "**/.vscode/**"
- "**/README.md" - "**/README.md"
@@ -20,6 +19,7 @@ on:
jobs: jobs:
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.ref_name != 'master'
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: psf/black@stable - uses: psf/black@stable
@@ -36,6 +36,7 @@ jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: lint needs: lint
if: github.ref_name != 'master'
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-python@v5 - uses: actions/setup-python@v5
@@ -47,7 +48,7 @@ jobs:
tag_and_publish: tag_and_publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.head_ref == 'master' || github.head_ref == 'dev' if: github.ref_name == 'dev' || github.ref_name == 'master'
needs: test needs: test
permissions: permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
@@ -57,7 +58,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-tags: true fetch-tags: true
ref: ${{ github.head_ref }} ref: ${{ github.ref_name }}
fetch-depth: 0 fetch-depth: 0
- name: setup git - name: setup git
@@ -65,25 +66,30 @@ jobs:
git config --local user.email "15138480+creyD@users.noreply.github.com" git config --local user.email "15138480+creyD@users.noreply.github.com"
git config --local user.name "creyD" git config --local user.name "creyD"
- name: set version format
id: version_format
run: |
if [[ ${{ github.ref_name }} == 'master' ]]; then
echo "version_format=\${major}.\${minor}.\${patch}" >> $GITHUB_OUTPUT
else
echo "version_format=\${major}.\${minor}.\${patch}rc\${increment}" >> $GITHUB_OUTPUT
fi
- name: Git Version - name: Git Version
uses: codacy/git-version@2.8.0 uses: PaulHatch/semantic-version@v5.4.0
id: git_version id: git_version
with: with:
minor-identifier: "feat:" tag_prefix: ""
major-identifier: "breaking:" major_pattern: "breaking:"
release-branch: ${{ github.head_ref }} minor_pattern: "feat:"
enable_prerelease_mode: false
version_format: ${{ steps.version_format.outputs.version_format }}
- name: Create & Push Tag - name: Create & Push Tag
if: github.head_ref == 'master' || github.head_ref == 'dev' if: github.ref_name == 'master' || github.ref_name == 'dev'
run: | run: |
if [ "${{ github.head_ref }}" == "master" ]; then git tag ${{ steps.git_version.outputs.version }}
git tag ${{ steps.git_version.outputs.version }} git push origin ${{ steps.git_version.outputs.version }}
git push origin ${{ steps.git_version.outputs.version }}
elif [ "${{ github.head_ref }}" == "dev" ]; then
calculatedSha=$(git rev-parse --short ${{ github.sha }})
git tag ${{ steps.git_version.outputs.version }}rc.dev${calculatedSha}
git push origin ${{ steps.git_version.outputs.version }}rc.dev${calculatedSha}
fi
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v5

View File

@@ -107,7 +107,7 @@ def paginate(
count_query = create_count_query(query) count_query = create_count_query(query)
total = connection.scalar(count_query) total = connection.scalar(count_query)
if paginationFlag is False: if paginationFlag is False and total > 0:
params = Params(page=1, size=total) params = Params(page=1, size=total)
query = create_paginate_query(query, params) query = create_paginate_query(query, params)